IntelliSense:无法在 C++ 中打开源文件“curl.h”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7623980/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IntelliSense: cannot open source file "curl.h" in C++
提问by user975017
I am unable to compile my C++ project.
我无法编译我的 C++ 项目。
IntelliSense: cannot open source file "curl.h" in C++
IntelliSense:无法在 C++ 中打开源文件“curl.h”
I tried adding that file to the "Header Files" folder in Solution Explorer: no change. I was unable to add it to the "Source Files" folder.
我尝试将该文件添加到解决方案资源管理器中的“头文件”文件夹中:没有变化。我无法将它添加到“源文件”文件夹中。
How can I fix this?
我怎样才能解决这个问题?
回答by Jason Newland
- Right click on your project
- select Properties
- Expand Configuration Properties
- Click on the VC++ Directories
- Add $(ProjectDir) into the "Reference Directories" item
- 右键单击您的项目
- 选择属性
- 展开配置属性
- 单击 VC++ 目录
- 将 $(ProjectDir) 添加到“参考目录”项中
回答by Noah
Under Visual Studio 2010/2012/2013
在 Visual Studio 2010/2012/2013 下
- Right click on your project
- select Properties
- Expand Configuration Properties
- Click on the VC++ Directories
- Add the path to your file, as well as $(ProjectDir), into the "Reference Directories" item
- 右键单击您的项目
- 选择属性
- 展开配置属性
- 单击 VC++ 目录
- 将文件路径以及 $(ProjectDir) 添加到“参考目录”项中
回答by roboto1986
If you've added the header file correctly, then sometimes intellisense can be corrupted and you will need to delete the .ncb file in you project. Once this is done, restart VS and see if this works. The .ncb file is the intellisense database file so if you delete this, VS will rebuild it.
如果您已正确添加头文件,那么有时智能感知可能会损坏,您将需要删除项目中的 .ncb 文件。完成后,重新启动 VS 并查看是否有效。.ncb 文件是智能感知数据库文件,所以如果你删除它,VS 将重建它。
回答by Depol
Under Visual Studio 2010/2012/2013
Right click on your project select
- Properties Expand Configuration
- Properties Click on the VC++
- Directories Add the path to your file,as well as $(VCInstallDir)lib;, into the "Reference Directories" item
在 Visual Studio 2010/2012/2013 下
右键单击您的项目选择
- 属性 展开配置
- 属性点击VC++
- 目录 添加文件路径,以及$(VCInstallDir)lib;, 进入“参考目录”项