How to include in CMake the files on which Eigen depends? -


i working on c project downloaded internet. trying add functions in eigen used linear algebra.

to end, added following lines cmakelists.txt :

pkg_check_modules(eigen3 required eigen3) include_directories(${eigen3_include_dirs}) link_directories(${eigen3_library_dirs}) add_executable(main main.c) target_link_libraries(main ${eigen3_libraries}) 

and no errors when running cmake . , make

the issue when try include <eigen/dense> in 1 of c functions, following error when try make:

/usr/include/eigen3/eigen/core:28:19: fatal error: complex: no such file or directory  #include <complex> 

eigen/dense includes eigen/core , eigen/core includes <complex> think it's not looking in correct directory find complex... how make there?

eigen in c++ library, while application source c file (main.c). since has .c extension, cmake threats c source , use c compiler, doesn't know c++ standard library (<complex>). rename main.c main.cpp.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -