Sign in to follow this  
ryan20fun

#define in app source not affecting dll header implementation

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this