Advertisement

include headers

Started by August 31, 2002 02:20 AM
12 comments, last by ShadowMaster 22 years, 5 months ago
Oops, sorry. I hoped I was wrong, and I was

The thing I wonder, though, is that your compiler output said "Building *.h". Cannot remember mine ever building header files. (Can be wrong, though.)

Hopefully I shall not offend you again, but I''ll try to explain in a quickie how C/C++ files are built:

In a project you add one or more "code" files; usually in the form of .cpp files, where all code that is going to be translated into machine instruction are and other constant data. When building the project, the compiler compiles each of these "code" files, alone or independently, into object files containing the native machine instructions plus linking information. Due to that all "code" files are build independently of each other, all functions, variables etc. used in each must be declared (not defined) so the compiler knows what they are. All those declarations are usually collected in one or more header files, which are included in all files that need them.
When all "code" files have been compiled into object files, they are sent to the linker to produce an executable, which resolves all function calls etc located in other object files.

Messy? I know I''m very bad explaining... but I''m trying the best I can to help you solve your problem. Could it be how you have set up your project? Perhaps added .h files as "code" files or something? (is that possible?)

If you still have problem here, please list all files in your project/workspace, and which other files they include, and perhaps we can be able to help you sort this out.
Btw, is Utils.h included in glpipe.h (or all files which include glpipe.h)? It must be. As I tried to explain, all files in the project are built independently before the linker stage, so all delarations msu be included in all files that uses them. It''s not good enough if they are declared somewhere in the workspace, or are in another file built.
Advertisement
The *.h files are not actualy built..I just added "#pragma message" so that I could found out were it's looking... Like I said I've fixed it..I think I'll leave it as is now. I just wish I knew why it was doing that..

Thanks a heap for all your help tho
-Shadow


http://nap.mega.net.kg



[edited by - shadowmaster on September 3, 2002 3:08:06 AM]
Home: EvilEntities ;)


[edited by - cANaBiTz on September 4, 2002 9:53:09 PM]

This topic is closed to new replies.

Advertisement