How do you statically link?

Started by
1 comment, last by ICUP 12 years, 8 months ago
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.
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)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
I'm using SDL 1.2.14 under LGPL. I'll be providing full source.

This topic is closed to new replies.

Advertisement