Combining SDL libs/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
Kyosaur
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Tue Jul 13, 2010 2:00 am
Favorite Gaming Platforms: PS2,PS3,NDS
Programming Language of Choice: C++

Combining SDL libs/dlls ?

Post by Kyosaur »

So i recently decided to add text rendering to my SDL "game" and noticed my project file is filling up quickly with SDL .dlls. All i do with SDL is load PNGs and JPEG images and yet i have like 5 dlls, thats just crazy. By the time my game has text and sound i could have 7-8 dlls!

Is there any way i can combine them all into a single dll? If not is there another media library i could look into that is simple like SDL, and doesnt require so much dlls? I know it may sound silly but having so much really bothers me, especially when your "game" is 100 lines, and hardly does anything at all. If at all possible i would really like to do the first option.


Sorry for making so much posts lately, im trying to keep my n00b questions to a minimum, but there's just so much i dont know :P.
Image
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Re: Combining SDL libs/dlls ?

Post by epicasian »

You could use SFML; some people call it "the object oriented SDL". With SFML, you can statically link the library, so you don't have a billion DLLs. As you can tell, I don't like seeing a lot of DLLs in my project root directery either :D

Hope this helps.
User avatar
kamokow
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 68
Joined: Wed Aug 05, 2009 9:36 pm
Programming Language of Choice: C++
Location: Canada

Re: Combining SDL libs/dlls ?

Post by kamokow »

epicasian wrote:You could use SFML; some people call it "the object oriented SDL". With SFML, you can statically link the library, so you don't have a billion DLLs. As you can tell, I don't like seeing a lot of DLLs in my project root directery either :D

Hope this helps.
You can statically link SDL too (or atleast you can in Linux), you just need to make your game open source if you do because SDL is licensed under the LGPL. Of course, if thats not your cup of tea then yes, you could use SFML.
Image
User avatar
JGorard159
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 44
Joined: Sun May 09, 2010 3:05 pm
Current Project: Azareal Online: MMO
Favorite Gaming Platforms: Virtual Boy. LOL WUT!?
Programming Language of Choice: Javascript
Contact:

Re: Combining SDL libs/dlls ?

Post by JGorard159 »

Both SFML and SDL are great for what I'm doing (basic windowing and input support for a GL engine); but as has already been suggested, SFML doesn't have as many ugly-ass DLLs randomly cluttering up the project directory. Still, I must say that SDL was easier to set up than SFML (for me at least, of course this may simply be due to my incompetance.) However, when building an entire game with all the blitting, rendering and gameplay programmed in SDL, I'm really not sure which would work best, though my vote would still be with SDL.
Savannah Cart of Ollege and Design

Current Project: Azareal Online. Visit us at: http://azareal-online.comuv.com
User avatar
Kyosaur
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Tue Jul 13, 2010 2:00 am
Favorite Gaming Platforms: PS2,PS3,NDS
Programming Language of Choice: C++

Re: Combining SDL libs/dlls ?

Post by Kyosaur »

SFML is one of my plans if i cant either statically link these dll's (im a noob, so no idea how to do this. Google was of no help either.) or physically combine all the dll's. I know its possible to do both options here (physically and legally), someone has to know how D: lol.
Image
User avatar
JGorard159
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 44
Joined: Sun May 09, 2010 3:05 pm
Current Project: Azareal Online: MMO
Favorite Gaming Platforms: Virtual Boy. LOL WUT!?
Programming Language of Choice: Javascript
Contact:

Re: Combining SDL libs/dlls ?

Post by JGorard159 »

I really don't think there's an easy workaround to this problem, in your case. What exactly is it about these excessive SDL dlls which annoys you? Is it simply the fact it contains so many files; because you can always zip the dlls up together into one file, then just add a little unzipper segment into your SDL code (will slow your game's load down considerably, but it does fix your multiple dll problem). I personally have never had a problem with having too many dll files, though maybe it's just that I haven't noticed them piling up :oops: !
Savannah Cart of Ollege and Design

Current Project: Azareal Online. Visit us at: http://azareal-online.comuv.com
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Combining SDL libs/dlls ?

Post by Falco Girgis »

If you're on a Windows platform, the Librarian (Archiver for you *Nix fuckers) WILL allow you to link against/embed other libraries. For example, on Windows, I literally include the OpenGL/SDL libs inside of libGyro.lib and only have to link against the single library. In the GCC environment, apparently the archiver *references* the other libraries but does not physically link against them wihen the library is built.

...but I still must ask the question... The entire point of dynamically linking versus static linking is that every library/resource is an external dependency that may be shared between processes... If you really hate having a bunch of external dependencies, you can use a resource editor or statically link against a library containing all of them.
User avatar
Kyosaur
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 78
Joined: Tue Jul 13, 2010 2:00 am
Favorite Gaming Platforms: PS2,PS3,NDS
Programming Language of Choice: C++

Re: Combining SDL libs/dlls ?

Post by Kyosaur »

GyroVorbis wrote:If you're on a Windows platform, the Librarian (Archiver for you *Nix fuckers) WILL allow you to link against/embed other libraries. For example, on Windows, I literally include the OpenGL/SDL libs inside of libGyro.lib and only have to link against the single library. In the GCC environment, apparently the archiver *references* the other libraries but does not physically link against them wihen the library is built.

...but I still must ask the question... The entire point of dynamically linking versus static linking is that every library/resource is an external dependency that may be shared between processes... If you really hate having a bunch of external dependencies, you can use a resource editor or statically link against a library containing all of them.

Thanks for replying! I'll look into this Librarian, i hope it solves my problem.

As for the your question, im new to C/++ so i really have no idea how i would statically link them at all. I tried to find a tutorial but i didnt have any luck. I really had no idea i could use a resource editor up until now, so that's why i didnt take that route.
Image
Post Reply