For starters I'm using Visual C++ 2008 Express Edition.
That aside, I have a visual studio solution test_project within a directory called test_project. IOW my directory structure is akin to:
c:\code\test_project
test_project.sln
test_project.vcproj
test_project.ncb
main.cpp
- executive
executive.h
executive.cpp
- common
common_header.h
Where within the directory test project there's two directories: "common and executive". Within the common directory there's a file named: "common_header.h". Within the executive directory I have two files: executive.h and executive.cpp
I added an environment variable to my system called: "TEST" with the directory: c:\code
Within my visual studio project I added the following line to my "VC++ Directories".
$(TEST)\test_project\common
From the Project Menu I selected Show All Files which imported the folders common and executive. I then right clicked and added each file within the folders
Later I ammended main to reflect
At issue: I'd like to eliminate the need to specify the directory within the source files. i.e I want to do: # include "common_header.h" as opposed to "# include "common\common_header.h". Trouble is the former generates a compiler error:Code:# include "common\common_header.h" # include "executive\executive.h" int main() { }
fatal error C1083: Cannot open include file: "common_header.h".
How do I circumvent this?


Reply With Quote
Bookmarks