Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   header files (http://www.go4expert.com/forums/header-files-t530/)

markyjj 11Dec2005 22:13

header files
 
Can anybody help with the following subject please

Ive made a program in C++ and stated that there is a header file (headerfile.h)to be used. However, when I compile the program a message appears saying that it is unable to include the header file.

Im not sure where I actually define the header file. Can this be defined in notepad or a directory within the program or within the same directory as Microsoft Visual Studio, the software that am using?

Any help would be very much appreciated...thanks

shabbir 12Dec2005 12:06

Re: header files
 
Quote:

Originally Posted by markyjj
Ive made a program in C++ and stated that there is a header file (headerfile.h)to be used. However, when I compile the program a message appears saying that it is unable to include the header file.

This error comes up when the compiler cannot find the header file in the current folder or in the specific folder specified. Make sure the header file exist in the same folder as the cpp file and use the following syntax.

Code:

#include "headerfile.h"
Quote:

Originally Posted by markyjj
Im not sure where I actually define the header file. Can this be defined in notepad or a directory within the program or within the same directory as Microsoft Visual Studio, the software that am using?

Its not necessary to have the header file in the same folder but its a good practice. If its not there in the same folder use the relative path to tell the compiler where it can find the header file.

Thanks
Shabbir Bhimani


All times are GMT +5.5. The time now is 10:29.