Too many DLLs!

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Too many DLLs!

Post 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.
User avatar
szdarkhack
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 61
Joined: Fri May 08, 2009 2:31 am

Re: Too many DLLs!

Post by szdarkhack »

If you think that looks messy, look at the Steam installation folder (or any game for that matter :lol: ). 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.
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Too many DLLs!

Post by superLED »

szdarkhack wrote:If you think that looks messy, look at the Steam installation folder (or any game for that matter :lol: ). 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.
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Too many DLLs!

Post 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.
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Too many DLLs!

Post 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).
User avatar
szdarkhack
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 61
Joined: Fri May 08, 2009 2:31 am

Re: Too many DLLs!

Post 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.
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: Too many DLLs!

Post 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!
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Too many DLLs!

Post 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.
User avatar
Nokurn
Chaos Rift Regular
Chaos Rift Regular
Posts: 164
Joined: Mon Jan 31, 2011 12:08 pm
Favorite Gaming Platforms: PC, SNES, Dreamcast, PS2, N64
Programming Language of Choice: Proper C++
Location: Southern California
Contact:

Re: Too many DLLs!

Post 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.
User avatar
Lisergishnu
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 24
Joined: Wed Jan 11, 2012 8:30 pm
Programming Language of Choice: C++
Location: Villa Alemana, CL

Re: Too many DLLs!

Post 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+
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Too many DLLs!

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Too many DLLs!

Post by N64vSNES »

szdarkhack wrote:If you think that looks messy, look at the Steam installation folder (or any game for that matter :lol: )
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 ;)
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Too many DLLs!

Post 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 ^^
User avatar
Nokurn
Chaos Rift Regular
Chaos Rift Regular
Posts: 164
Joined: Mon Jan 31, 2011 12:08 pm
Favorite Gaming Platforms: PC, SNES, Dreamcast, PS2, N64
Programming Language of Choice: Proper C++
Location: Southern California
Contact:

Re: Too many DLLs!

Post 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.
Post Reply