Jump to content
  • Advertisement


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


Static or Dynamic library

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

You could do something like this:

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

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.

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!