Skip to main content
GameDev.net gamedev.net
🔒 Locked

statically linking specific .DLL ?

Started by yoni0505 Dec 14, 2010 at 2:55 PM 0 replies 1.7k views
Original Post
yoni0505
yoni0505
Is it possible to statically link a specific .DLL file?
I'm using SDL and I have to include the SDL.dll file so I have to pick "multi-threaded DLL".

I don't want to include the msvcr100.dll with my program, I already saw a SDL program which got the SDL.dll and (Multi-threaded DLL) but doesn't depend on msvcr100.dll .

I guess there is some way to statically link specific .dll, yet google didn't reveal me the answer...

I tried to link msvcrt.lib but it didn't work... :(

So is it possible? [wink]
jpetrie
jpetrie
Quote:

Is it possible to statically link a specific .DLL file?

No. But you can statically link to the import library, if one was provided, or manually LoadLibrary() the DLL and GetProcAddress() to get the exports.

Quote:

I don't want to include the msvcr100.dll with my program,

You have to, it implements the C runtime which your program requires. There are ways to link to a static version of the runtime, but they have security implications. Using the DLL is the preferred approach.

Quote:

I already saw a SDL program which got the SDL.dll and (Multi-threaded DLL) but doesn't depend on msvcr100.dll .

It does (or maybe it depends on an earlier version). Without the C runtime, you can't use most of the language features you probably expect to exist.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.