Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Problems Including Files

This topic is 6514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my header files, I use the standard #ifndef _MYINCLUE_H #define _MYINCLUE_H #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // stuff #endif Anyhow, when adding a few new include files to my project, things started to get wierd. When I would include the file once in WinMain.cpp, it wouldn''t load it again in any of the other modules. I know this is what it''s supposed to do, keeping compile times down and all, but I''m getting errors like: base class undefined missing storage-class or type specifiers which means it isn''t loading the reading the classes. I know I sound really stupid, but this has worked for a while. So what am I overlooking? Thanks in advance

Share this post

Link to post
Share on other sites
One common mistake is to have cyclic references ie:

#ifndef __FILE1_H__
#define __FILE1_H__

#include "file2.h"

// My other defines

#endif // __FILE1_H__

#ifndef __FILE2_H__
#define __FILE2_H__

#include "file1.h"

// My other defines

#endif // __FILE2_H__

The compiler doesnt know which to process first. This will cause problems with things not being found.

Also make sure of obvious things, like you are including the file with your definition in it BEFORE it is used.

As headers get more complex, it is easy to overlook things like this.

Edited by - shamen on July 19, 2000 2:53:11 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!