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
Code:
# include "common\common_header.h"
# include "executive\executive.h"
int main() {
}
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:
fatal error C1083: Cannot open include file: "common_header.h".
How do I circumvent this?
December 13th, 2009, 11:04 PM
Ejaz
Re: #include question
[Moved Thread]
First, please post the question to the relevant board. It helps to get the question answered quickly and accurately.
Next, you can achieve that you setting the "common" folder path in the project settings (i.e. Project Properties -> C/C++ -> Additional Include Directories).