c++ - 错误 "C1083 cannot open include file gecode/int.hh"尽管路径设置正确

标签 c++ include visual-studio-2015

在Win8.1上使用VisualStudio2015 Express

我已经设置了我的外部包含文件的位置 进入项目配置/VC++包括目录: $(VC_IncludePath);"C:\Program Files\Gecode\include"

编译器仍然说“C1083 无法打开包含文件 gecode/int.hh” 编译时:

#include <gecode/int.hh>

但是当我将 C++ 源代码更改为:

 #include <C:\Program Files\Gecode\include\gecode\int.hh>

!! 只有下属包含将无法工作 - 这不是一个好的解决方案......

之前提出的其他解决方案对我有用:

  • 删除 .hh

  • 在包含之后用“”替换<>

最佳答案

问题很可能是您的项目设置的 include directories 不接受(或奇怪地对待)具有嵌入空格的文件路径。

因此,您应该在文件路径名称两边加上引号:

 $(VC_IncludePath);"C:\Program Files\Gecode\include"

关于c++ - 错误 "C1083 cannot open include file gecode/int.hh"尽管路径设置正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32353209/

相关文章:

c++ - 如何在模板中调用带有参数的模板函数?

c# - 使用反射打印自己的方法名、类库(可移植)

c++ - 链接器错误构建 GDAL

在头文件 VS2010 中定义的 c++ 预编译头文件。编译器找不到

c++ - 返回带有模板函数的泛型

c++ - 如何用ifstream读入对象成员?

php - 将一些电子邮件包含在一个电子邮件中

c++ - 重载三元? : operator, 或更改为包含文件中的 if{}else{}

c++ #include(什么函数在什么里面)

c# - 无法从 Nuget 安装包 System.Net.Http