#include <Eigen/Dense> no working if used in View3DInventorViewer.cpp

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

#include <Eigen/Dense> no working if used in View3DInventorViewer.cpp

Post by nyholku »

Hi,

I'm experimenting with View3DInventorViewer and would like to use eigen there.

I see that

Code: Select all

FreeCAD-git/src/Mod/Sketcher/App/planegcs/qp_eq.h
includes eigen like this

Code: Select all

#include <Eigen/Dense>
but when I do that in

Code: Select all

FreeCAD-git/src/Gui/View3DInventorViewer.cpp


I get:

Code: Select all

/Users/nyholku/FreeCAD/FreeCAD-git/src/Gui/View3DInventorViewer.cpp:2822:10: fatal error: 'Eigen/Dense' file not found
I've verified that 'qp_eq.h' gets compiled and so I know the include works there
but I'm at loss why it does not work in 'View3DInventorViewer.cpp'
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: #include <Eigen/Dense> no working if used in View3DInventorViewer.cpp

Post by nyholku »

Ok found the solution:


In file:

Code: Select all

FreeCAD-git/src/Gui/CMakeLists.txt
I need to include (pun intenede) eigen3 in the include_directories:

Code: Select all

include_directories(
    ${EIGEN3_INCLUDE_DIR}
    ${CMAKE_BINARY_DIR}
Pretty basic if you understand FreeCAD build structure and CMake ;)

Sorry about the noise.

wbr Kusti
Post Reply