Jump to content
  • Advertisement
Sign in to follow this  
ICUP

How do you statically link?

This topic is 2621 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'm done with a game I made and want it to be statically linked against SDL so that I don't have to distribute .dll files and VC++ redist. files.

What is the exact process I need to take?

I downloaded the SDL, SDL_image, SDL_mixer, and SDL_ttf source code, recompiling them as static libraries with /MT and /MTd. When using the newly compiled object library files, I get errors from SDL.lib and SDL_mixer.lib about unresolved externals (basically all the functions can't be found).

One thing I'm unsure about: when I compile the source, for some subsystems like SDL_mixer, there are subprojects, (something like) Timidity. Do those also need to be set to static library output? Do those code generation settings need to be set to /MT or/MTd? I did this, but didn't work.

Share this post


Link to post
Share on other sites
Advertisement

I'm done with a game I made and want it to be statically linked against SDL so that I don't have to distribute .dll files and VC++ redist. files.

What is the exact process I need to take?

I downloaded the SDL, SDL_image, SDL_mixer, and SDL_ttf source code, recompiling them as static libraries with /MT and /MTd. When using the newly compiled object library files, I get errors from SDL.lib and SDL_mixer.lib about unresolved externals (basically all the functions can't be found).

One thing I'm unsure about: when I compile the source, for some subsystems like SDL_mixer, there are subprojects, (something like) Timidity. Do those also need to be set to static library output? Do those code generation settings need to be set to /MT or/MTd? I did this, but didn't work.


What version of SDL are you using ? and under what license ?

If you're using the LGPL version you need to ensure that the end user can replace or modify the SDL library somehow (The easiest way to do this without providing full source code is to link dynamically as then you only need to provide the code for the dlls)

Share this post


Link to post
Share on other sites
Sign in to follow this  

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