It can be available at http://stackoverflow.com/questions/23856967/release-build-does-not-work-error-with-eigen-library
When I build my program in debug mode, everything works fine. However, when I switch to release build, I get the following errors. It seems that there is a problem with Eigen
. Could anyone please help?
1>------ Build started: Project: qtdemo, Configuration: Release Win32 ------
1> moc_qtdemo.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\generatedfiles\release\../../qtdemo.h(6): fatal error C1083: Cannot open include file: ‘Eigen/Dense‘: No such file or directory
1> main.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\qtdemo.h(6): fatal error C1083: Cannot open include file: ‘Eigen/Dense‘: No such file or directory
1> qtdemo.cpp
1>c:\users\documents\visual studio 2012\projects\qtdemo\qtdemo\qtdemo.h(6): fatal error C1083: Cannot open include file: ‘Eigen/Dense‘: No such file or directory
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The include directories need to be set for both debug and release mode. (And, more generally, for whichever configuration you support).
This is because you may want different settings for a specific configuration mode. For example, you‘d want to link to a debug library for a debug build, or turn optimizations on for a release build, and so on.
This can be done under Visual Studio through Project --> "name of project" properties --> VC++ directories
, and selecting in the top bar the configuration you want to change the settings of.
Also note that setting can be changed for all the configurations at the same time by selecting "All configurations", like shown in the following picture: