Sign in to follow this  
ICUP

How do you statically link?

Recommended Posts

ICUP    140
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
SimonForsman    7642
[quote name='ICUP' timestamp='1313552250' post='4850133']
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.
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this