Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can not include a header file

Status
Not open for further replies.

yasin007

Programmer
Oct 14, 2003
13
0
0
SG
Hi,

Iam bit new to C . I built a project in Visual C++,namely "Test" .

Then i created a folder under "Header Files",namely "layout" . Under this layout folder
i added "test.h" header file .

Then I added a sample.c file under "Source files" .This c file just tries to include the "test.h" header file .

So in C file , i put the syntax as #include "layout/test.h" .

When i save & compile this c file , its giving the following error.


fatal error C1083: Cannot open include file: 'layout/test.h': No such file or directory
Error executing Test.exe.


Any help highly appreciated.
 
Hi Yasin,

Although it appears to be in the folders like layout etc, but these are just the logical divisions. So you cannot write layout/test.h etc.

Alll these folders are just a way to divide your files in logical groups. These do not actully exist in the file system. That is the reason why it is unable to find the layout/test.h. So just write include "test.h". This shall work.

Hope this works.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top