Page 1 of 1
Too many DLLs!
Posted: Wed Jan 18, 2012 6:46 am
by superLED
Hi there, folks!
For my graphical projects in MVSC++ I am using SDL. That means, I end up having dozens DLLs. (SDL.dll, SDL_image.dll, SDL_ttf.dll, sdlgfx.dll, SDL_mixer.dll ... and so on)
These DLLs have to be in the same directory as my executable to make the project work. And it simply looks really messy.
So my question is:
Is there a way to move those DLLs in a 'dll' folder, to better organize the filesystem?
As said, I use MVSC++ as my IDE, but I'm not that experienced with most of the settings, so a little spoon feeding may be required. Sorry.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 7:51 am
by szdarkhack
If you think that looks messy, look at the Steam installation folder (or any game for that matter
). As for your question, i didn't find anything with a quick google search, but i might look more into it later when i have the time.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 8:00 am
by superLED
szdarkhack wrote:If you think that looks messy, look at the Steam installation folder (or any game for that matter
). As for your question, i didn't find anything with a quick google search, but i might look more into it later when i have the time.
True, but with steam, you launch the game most likely from steam itself, or the automatically created shortcut on your desktop, so it's not often you must dig through the sea of DLLs :p
And thanks for your time, googling for me. I've tried that as well, but found nothing that could help me.
I know there must be a way, since I've seen it a lot - game folders with a separate dll folder.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 8:04 am
by TheBuzzSaw
I don't have experience linking to libraries based on relative folder location, but a common trick I've seen is to have a "bin" folder that contains your main binary and all the DLLs. Then, in the main directory, there is a single script to run it (either a .bat or a .sh). That keeps it fairly clean. I try to reduce how many DLLs I use too, but I've given up on trying to link them in some other folder.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 8:12 am
by superLED
TheBuzzSaw wrote:I don't have experience linking to libraries based on relative folder location, but a common trick I've seen is to have a "bin" folder that contains your main binary and all the DLLs. Then, in the main directory, there is a single script to run it (either a .bat or a .sh). That keeps it fairly clean. I try to reduce how many DLLs I use too, but I've given up on trying to link them in some other folder.
I guess this could be a good temporary solution.
I don't know, but for an average user it may be scary to open such as a .bat file (they are used to open .exe files, and that is what they will be looking for).
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 9:00 am
by szdarkhack
superLED wrote:TheBuzzSaw wrote:I don't have experience linking to libraries based on relative folder location, but a common trick I've seen is to have a "bin" folder that contains your main binary and all the DLLs. Then, in the main directory, there is a single script to run it (either a .bat or a .sh). That keeps it fairly clean. I try to reduce how many DLLs I use too, but I've given up on trying to link them in some other folder.
I guess this could be a good temporary solution.
I don't know, but for an average user it may be scary to open such as a .bat file (they are used to open .exe files, and that is what they will be looking for).
Well, you could always have your installer create a folder with all the binaries in it and add a shortcut on the desktop or something, like almost all games do. The user just clicks the shortcuts and he's "protected" from looking through a sea of DLLs.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 9:46 am
by short
superLED wrote:
I don't know, but for an average user it may be scary to open such as a .bat file (they are used to open .exe files, and that is what they will be looking for).
Awww, poor guy/girl, they must be so scared!
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 10:09 am
by superLED
short wrote:superLED wrote:
I don't know, but for an average user it may be scary to open such as a .bat file (they are used to open .exe files, and that is what they will be looking for).
Awww, poor guy/girl, they must be so scared!
Not scary as in "OMG I'm so scared!", but they may think that this file is not supposed to open the game.
The only thing I want to accomplish is to follow the standard, so there's a minimum chance of getting confused.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 10:28 am
by Nokurn
There are two main solutions I can think of:
- Use a launcher application to set the Path environment variable and then run your program.
- Use a launcher application to set up App Paths and then run your program. Once deployed, your launcher will be rendered unnecessary (unless it performs other tasks), and you can later avoid it by using an installer that sets the App Path.
Launchers are fairly common in games. Blizzard uses them a lot, Skyrim uses one, basically every MMO uses one.
Re: Too many DLLs!
Posted: Wed Jan 18, 2012 10:35 pm
by Lisergishnu
Nokurn wrote:There are two main solutions I can think of:
- Use a launcher application to set the Path environment variable and then run your program.
- Use a launcher application to set up App Paths and then run your program. Once deployed, your launcher will be rendered unnecessary (unless it performs other tasks), and you can later avoid it by using an installer that sets the App Path.
Launchers are fairly common in games. Blizzard uses them a lot, Skyrim uses one, basically every MMO uses one.
This 1+
Re: Too many DLLs!
Posted: Thu Jan 19, 2012 3:31 pm
by dandymcgee
You don't even need a launcher. Just pack your game in an installer that puts all the files in the Program Files directory, and a shortcut on the desktop. Same as any other application.
Re: Too many DLLs!
Posted: Thu Jan 19, 2012 4:13 pm
by N64vSNES
szdarkhack wrote:If you think that looks messy, look at the Steam installation folder (or any game for that matter
)
This^.
They're definitely not panicking. Microsoft who came up with this whole "DLL business" definitely don't seem to be panicking from the looks of their programs directories
Re: Too many DLLs!
Posted: Thu Jan 19, 2012 6:19 pm
by superLED
I think I will go for the installer method, with a shortcut put on the desktop. Thanks for all of the advice! Really appreciated ^^
Re: Too many DLLs!
Posted: Thu Jan 19, 2012 10:13 pm
by Nokurn
superLED wrote:I think I will go for the installer method, with a shortcut put on the desktop. Thanks for all of the advice! Really appreciated ^^
If you're talking about using a specific working directory, you might also want to consider the possibility if your EXE being launched directly from Explorer, where the working directory will be set to the EXE's directory.