Advertisement Jump to content


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


DLL Using a #define Type w/o Include in the DLL

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

I may sound like an idiot, but here it goes: I have a type (namely FWRESULT) that is defined as follows in a header file:
#define FWRESULT int
I also have a dll, in which is contained my engine, which is basically a wrapper at this point. My question is: if the application (my game) includes the header in which FWRESULT is defined, and then the application includes the library for the dll (my engine) in the Project--Settings window, and then in the dll is code that uses FWRESULT, will it work? I''m thinking that it might not, as the dll doesn''t include the header. Now another question if the answer to the above is that it won''t work: then to include the header, should I just make the header not part of any dll and then include it within the dll? I''m tired from a long day, so in the morning I''ll probably think back and say how easy it would have been to answer this silly post myself, but thats then and this is now... :\

Share this post

Link to post
Share on other sites
FWRESULT is just a macro. In any source files that include this header file, just think "int" wherever you see "FWRESULT". Headers aren''t part of DLLs; macros only matter during preprocessing, not compillation or linking. So, yeah, this''ll work fine.

"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!