Jump to content
  • Advertisement
Sign in to follow this  
ryan20fun

#define in app source not affecting dll header implementation

This topic is 2806 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

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!