Archived

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

jtmerchant

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

Recommended Posts

jtmerchant    126
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
Sneftel    1788
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