Reputation: 1564
Long story short : I had some functions I thought could be useful in a library instead of just copying the functions from one project to the next one. So I created a library project and put my header file and cpp file in the project, referenced it with my second project (in the same solution) and everything is working fine.
Here's my problem. I want to add an other set of functions in different files. So I created a new header file and a new cpp file, but now I don't seem to be able to include
the new header file. the other one works fine, but the new one can't be included and VS gives me these error codes :
E1696 cannot open source file "2ndFunctionSet.h" [2ndProjectName] [FileNameA]
C1083 include : '2ndFunctionSet.h' : No such file or directory [2ndProjectName] [FileNameA]
Here's a summary of the current structure of the solution :
SolutionName
|---project > CommonLibraries
| |---{header files}
| | |---baseFunctions.h
| | |---2ndFunctionSet.h
| |---{source files}
| |---baseFunctions.cpp
| |---2ndFunctionSet.cpp
|
|---project > 2ndProjectName
|---{header files}
| |---someClass.h
| |---mainCode.h
|---{source files}
|---someClass.cpp
|---mainCode.cpp
both cpp files from the common libray include their header files and the stdafx.h
default precompilation file and both seem to be constructed similarly.
Can you please help me understand what I have done wrong? I haven't been doing c++ for a while, so it is likely I did a procedure error when creating my library project or when I created the new function set file.
Upvotes: 1
Views: 18957
Reputation: 1564
The files are not in the same folder.
You should also check if the files that are "working" are in the proper folder :
Now on "How to include those files in a project of the same solution" :
"Configuration Properties"
> "c/c++"
> "General"
Upvotes: 1