hai guys..just now before i download one header file for c.but i do't know how to use that,..tat header file is needed for another compiling of program....any body know pls tell.(in windows XP)
compiling header file
Collapse
X
-
Tags: None
-
Header files contain declarations that may be needed in more than one implementation file (.c or .cpp). Rather than hard-code the declaration in every file, they are put in a header file.
Header files are just text files. By tradition, in C they have a .h extension and in C++ they have no extension. However, this is optional and not checked by the proprocessor.
Just:
#include <MyHeader.h>
or
#include "MyHeader.h "
The <> format says the header file is located along a predefined path. Known as "the usual places". You define these paths by going to your project's properties and looking at the ones for the preprocessor. One of thise properties is "additional include directories".
The " " format says the header file is located in the same folder as the implementation file. If it's not, then the usual places are searched sames is if you had used the <> format. -
k.but to compile that header file is need.when i execute that program it wants that header fille.how can i use the new header file..pls tellComment
-
-
-
Please clarify ... do you get an error when you compile (build) your program or when you execute it? You keep saying the problem occurs when you execute your program, but that doesn't make any sense if we're talking about C preprocessor header files. Perhaps we're talking about something else.Comment
-
The header file you compiled basically tells the compiler -> "I'm going to be using these classes and functions. Don't worry about it now; I'll provide them later".
When you run the program, the program now says "Where is the compiled code for these classes and functions you told me about?"
You probably need to provide the compiled object code .o, for these headers that you used, when you are running your file.Comment
Comment