c++ - 发布版本不起作用 - Eigen 库出错?

标签 c++ visual-studio-2012 eigen

当我在 Debug模式下构建程序时,一切正常。但是,当我切换到发布版本时,出现以下错误。 Eigen 好像有问题。有人可以帮忙吗?

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 ==========

最佳答案

需要为调试和 Release模式设置包含目录。 (更一般地说,无论您支持哪种配置)。

这是因为您可能需要针对特定​​配置模式进行不同的设置。例如,您想要为调试构建链接到调试库,或为发布构建打开优化,等等。

这可以在 Visual Studio 下通过 Project --> "name of project"properties --> VC++ directories 完成,然后在顶部栏中选择要更改设置的配置。

另请注意,可以通过选择“所有配置”来同时更改所有配置的设置,如下图所示: enter image description here

关于c++ - 发布版本不起作用 - Eigen 库出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23856967/

相关文章:

c++ - 如何确定矩阵在 Eigen 中是否可逆(正则、非奇异、满秩……)?

c++ - 为什么我只能使用 auto 类型创建函数别名?

c++ - 连接问题

visual-studio-2010 - Asp.net 4.0尚未注册

c++ - 为什么选择 Eigen 用于 TensorFlow?

cmake - 如何将 FetchContent_Populate 与 Eigen 一起使用?

c++ - 如何在不多次调用的情况下使用 GetAsyncKeyState?

c++ - 循环依赖问题

entity-framework - Enable-Migrations 安装错误

visual-studio-2012 - 无法在 Visual Studio 即时窗口中使用 WinDbg 和 SOS