5

I am unable to compile my C++ project.

IntelliSense: cannot open source file "curl.h" in C++

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?

bzlm
  • 9,626
  • 6
  • 65
  • 92
user975017
  • 89
  • 1
  • 1
  • 3

4 Answers4

16
  • Right click on your project
  • select Properties
  • Expand Configuration Properties
  • Click on the VC++ Directories
  • Add $(ProjectDir) into the "Reference Directories" item
Jason Newland
  • 481
  • 5
  • 3
6

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 $(ProjectDir), into the "Reference Directories" item
Noah
  • 15,080
  • 13
  • 104
  • 148
0

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.

roboto1986
  • 624
  • 2
  • 13
  • 28
  • Thank you, but that did not work. Once I did that I had the same error, just not with intellisense. BTW, I right clicked and pressed "go to file or whatever" and then it brought me to the file! So it knows the file is there, it just can't find it for some reason D:< Any other ideas why it didn't work? – user975017 Oct 02 '11 at 02:23
  • 3
    Did you include it as #include<"myfile.h"> or #include "myfile.h" because you are not supposed to put "<>" when including your own header files. Use the "<>" to include c++ standard header files. So in your case, put #include "myfile.h" – roboto1986 Oct 02 '11 at 16:52
-1
  • 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
Depol
  • 1