February 22nd, 2000, 08:01 AM
Hi I have a little include problem. I will try to explain it as good as I can. Here is some code from a class:
// test.h
#ifndef .....
#define ...
#include <macrodef.h>
#include <stuff.h>
class test {
public:
...
private:
SOME_STRUCT *struct;
};
#endif
SOME_STRUCT is defined in stuff.h and therefore stuff.h is needed in this file.
The thing is the code to this is placed in "test.cpp" which is including "test.h". So far so good. The problem is that "stuff.h" is defining a macro of a macro defined in "macrodef.h". That new macro is needed in "test.cpp". If I compile this VC++ complins anut that this macro is aldready defined in the start file wich includes "test.h".
It seems that "macrodef.h" must only be included once. Sice the macro is only used in "test.cpp" I would like to include it in there but I must include "macrodef.h" before "stuff.h" and I need that file in "test.h".
Do you understand my problem? Is there a good way to solve this?
Excuse me for my language..
/ Anders
// test.h
#ifndef .....
#define ...
#include <macrodef.h>
#include <stuff.h>
class test {
public:
...
private:
SOME_STRUCT *struct;
};
#endif
SOME_STRUCT is defined in stuff.h and therefore stuff.h is needed in this file.
The thing is the code to this is placed in "test.cpp" which is including "test.h". So far so good. The problem is that "stuff.h" is defining a macro of a macro defined in "macrodef.h". That new macro is needed in "test.cpp". If I compile this VC++ complins anut that this macro is aldready defined in the start file wich includes "test.h".
It seems that "macrodef.h" must only be included once. Sice the macro is only used in "test.cpp" I would like to include it in there but I must include "macrodef.h" before "stuff.h" and I need that file in "test.h".
Do you understand my problem? Is there a good way to solve this?
Excuse me for my language..
/ Anders