Jump to content
  • Advertisement

Archived

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

Static or Dynamic library

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

Advertisement
You could do something like this:


#ifdef BUILD_DLL
#define MY_API __declspec(dllexport)
#else
#define MY_API __stdcall
#endif

int MY_API SomeFunction(void);



This way if you define the symbol MY_API then all the methods which you have prefixed with MY_API will be exported to the .dll otherwise they will be compiled as ordinary methods.

To create the .lib and .dll you will need two separate projects to build each version but the source code will be the same in both projects, you don't have to make changes to export the methods in the .dll project for example.

[edited by - Spudder on January 17, 2004 8:16:59 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!