-1

A coworker of mine quit today and I was handed some of her projects.

She gave me a Visual Studio project folder. In it are 30 cpp and 30 h files.

When I opened the vcproj file, it prompted me that it was created using visual studio 10 and since I have vs 12, I chose the update prompt.

I then proceeded to build the project. However, 29 errors come up saying the foo.h, bar.h... could not be opened. No such file or directory.

Error:

cannot open include file: 'includedFile.h'; no such file or directory.

I found other posts that also talked about these issues. However, I don't think these links apply since all of the header files are in the same folder structure as my project and its corresponding cpp file.

Example Folder Structure:

>ProjectFolder
|- project.vcxproj
|- main.cpp
|- main.h
|- foo.cpp
|- foo.h
|->Debug
|->Res


Do I have to manually add each of the header files to the include as noted by the following comment from the 2nd reference above?

Go to your Project properties (Project -> Properties -> Configuration Properties -> C/C++ -> General) and in the field Additional Include Directories add the path to your .h file.

Community
  • 1
  • 1
Cripto
  • 3,581
  • 7
  • 41
  • 65
  • The comment you quote tells you how to add an include *directory*, assuming your files aren't all in different directories, then no you don't need "to manually add each of the header files...". – Tony Delroy Apr 30 '15 at 04:16
  • It is phrased a bit confusingly. What it means is: There is a text box under projects -> properties -> ... where you can set additional include paths where the compiler will look for headers. Add the correct stuff there and voilà. Probabily this is set already in the old project but she forgot to set it for all platforms and all configurations. Or she set an absolute path there which does not match your requirements on your computer. – BitTickler Apr 30 '15 at 04:19

1 Answers1

0

For anyone else running to this issue.

The following statement was poorly thought out

I found other posts that also talked about these issues. However, I don't think these links apply since all of the header files are in the same folder structure as my project and its corresponding cpp file.

I was assuming since they are Visual Studio projects, that visual studios would link them. This is not correct. Since Visual Studios decides to do alot of nice things, one of them is that it will try to link for you. So make sure that the project settings are properly constructed.

EVEN if it used to work. Double check.

Cripto
  • 3,581
  • 7
  • 41
  • 65