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

Compiling libraries under windows.

Started by ........................................ Mar 3, 2009 at 1:00 PM 11 replies 1.8k views
Original Post
I really don't get it. Everytime I try to compile a library I encounter a different problem. Is there some kind of FAQ that solves most problems? Is it easier with Visual studio than with code::blocks + g++? (I use the latter one) Just to give an example: SDL_mixer: Documentation says nothing about windows compiling. Pretty much all it says is:
Quote:
./configure make make install
So I download make and get
Quote:
C:\Dokumente und Einstellungen\Philipp\Eigene Dateien\c++\Unixutils\SDL>make Makefile.in make: Nothing to be done for Makefile.in'. C:\Dokumente und Einstellungen\Philipp\Eigene Dateien\c++\Unixutils\SDL>make Makefile.in install make: Nothing to be done for Makefile.in'. make: *** No rule to make target `install'. Stop.
Am I the only person with such problems, and if so why? :(
Palidine
Palidine
Why would you compile it and not just download the already compiled library:
http://www.libsdl.org/projects/SDL_mixer/

At any rate, it's possible you downloaded the wrong source tree. Open up the makefile and see if it actually has a path for windows compilation.

Or maybe you downloaded the already compiled library, and make is just exiting because nothing has changed so there's no need to recompile?

Or you're perhaps just not passing the correct parameters to make. Again, read the makefile and see what you need to pass to compile the windows libraries: like "make win" or whatever...

-me
Zakwayda
Zakwayda
Did you do the 'configure' step?

Generally speaking, building libraries or applications from source is not trivial (at least not always), so no, you're not the only one who has trouble with it. However, it'll get easier the more familiar you become with whatever tools you're using (GCC, make, VC++, etc.).

On Windows, you might have a little more luck with VC++ than with GCC via the command line. IIRC, the SDL source package comes with a Visual Studio project that you should be able to use to build the library with little trouble. Also, if it's the most recent stable version of SDL that you're interested in (1.2.13), there are pre-built binaries for Windows available on the website.
swiftcoder
swiftcoder
Quote:
Original post by philipptr
Quote:
Original post by jyk
Did you do the 'configure' step?
How would I do that on windows? On Linux I would just type ./configure which seems impossible in a win32 commandline :/
Most of these libraries don't support command line development on Windows. Either just use the pre-built binaries, or look for an included project file (probably for MSVC).
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
swiftcoder
swiftcoder
Quote:
Original post by philipptr
Maybe I am blind or dumb, but I can't seem to find the .a files I would need for g++.
Well, at least I think I need them... I do, right?
All the SDL libraries are distributed as dynamic libraries (.DLL) on Windows.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Quote:
Original post by swiftcoder
Quote:
Original post by philipptr
Maybe I am blind or dumb, but I can't seem to find the .a files I would need for g++.
Well, at least I think I need them... I do, right?
All the SDL libraries are distributed as dynamic libraries (.DLL) on Windows.


yes, but for compiling something that links sdl i still need libSDLmain.a
Nypyren
Nypyren
.a files are typically called .lib files in Windows land... did you get one of those when you compiled it?
Quote:
Original post by Servant of the Lord
[Setting up SDL with Code::Blocks on Windows]


I am talking about SDL_Mixer.

Quote:
Original post by Nypyren
.a files are typically called .lib files in Windows land... did you get one of those when you compiled it?


In the lib folder of mingw all library files are called .a plus when I put the linux .a files in there the linker is able to find -lSDL_Mixer but this doesn't seem to work either since I get undefined references then...
Palidine
Palidine
Quote:
Original post by philipptr
I am talking about SDL_Mixer.


er.... I posted a link to the pre-compiled binary windows distribution:

http://www.libsdl.org/projects/SDL_mixer/

They are DLLs only for SDL Mixer.

To get the SDL binaries go here http://www.libsdl.org/download-1.2.php. Download the development library for windows. And it's called SDLmain.lib on windows. (file extension doesn't matter .a .lib whatever).

-me
fcoelho
fcoelho
Quote:

In the lib folder of mingw all library files are called .a plus when I put the linux .a files in there the linker is able to find -lSDL_Mixer but this doesn't seem to work either since I get undefined references then...


You're trying to compile a windows application using a library compiled under linux?


If you're really willing to compile it, import the msvc project from codeblocks, it worked just out of the box most of times for me(not sdl_mixer, I never compiled it, just got the precompiled one :]). You may have to tweak a few include/library paths/lib names, but it's generally not a big deal.
You can still download MSYS and all the autotools to compile it.
As a third option, compile it in VS and run reimp on the library created so you can work with MinGW.

Topic Locked

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

Sign in to reply to this topic.