#define in app source not affecting dll header implementation

Started by
2 comments, last by rip-off 13 years, 5 months ago
Hi all,
I am defineing _DEBUG_ENGINE_ in my testing a so that it will affect the dll projects operation, but it doesent register it as
Being defined.
Am I doing something wrong, because when you include windows.h you can define something to remove rarely used stuff from it,
And I want to do a very similar thing with my dl project,

Thanks for the awnsours in advance.

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.

Advertisement
Preprocessor defines only work at compile time. That is, once your dll is built you cannot affect it using defines. A common approach to this is to build the dll twice, once with debug enabled and once without. The two dlls would need different names. Then instruct the IDE to link to the debut library in Debug and the normal one in Release.

Windows.h is different, you aren't removing the functions, just their declarations.
Thanks,
Ill work on implementing that.

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.

It would be a good idea to spend some time learning how the C++ compilation model works. Once you understand how the preprocessor is only a slightly more complex version of copy and paste, you will understand why this wouldn't work.

This topic is closed to new replies.

Advertisement