# Code only used if DLL is found?

This topic is 4739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to make a small application that does various things, but only if a specific DLL exists. Example code:
SDL_Surface *LoadImage(string filename)
{
SDL_Surface *tmpsurface;

if (DLLFound("SDL_image.dll"))
{
} else {
}

return tmpsurface;
}

But the I will still need SDL_image.dll to start the application, since the .lib is linked. Any way around this? Thanks in advance!

##### Share on other sites
You'll need to dynanically link with the DLL instead of staticly linking with the dll's lib, i don't have the details to hand at the moment but a google should find details, else im sure someone will be along soon with more info :)

##### Share on other sites
It can be a bit messy though..

• 22
• 10
• 19
• 14
• 20