| Linking SDL Statically |
|
Spirrwell
|
Alright, I figured out what the problem was and that was that the dynamic libraries weren't built properly when I built SDL 2.0 and so Code::Blocks went with the static libraries. So what I want to know is how do I link SDL 2.0 statically with Code::Blocks without all of these errors?
|
|||||||||||
|
|
||||||||||||
|
Taiki
|
Hi,
I've the same kind of issue but I want to add some details: It compiles fine with Visual C (but not with ICC nor MinGW) and the Visual C build isn't usable by MinGW but here is it if someone want to invistigate: https://www.dropbox.com/s/cuylbh3haby5bg9/SDL.lib The problem is to mix VC and MinGW includes, that creates a lot of conflict. Issues start with #include <ddraw.h>, a header contained in the DirectX SDK but if you add it the the compiler path search, dependencies issue will appear and then conflicts between MinGW and VC includes (I guess) create brazillions error. My knowledges in DirectX aren't good enough to fix it myself so, I join the Spirrwell request :X Regards Taiki |
|||||||||||
|
|
||||||||||||
| Linking SDL Statically |
|
Doug
Guest
|
hm... I'm not sure what original thread you're referring to, but you can't mix and match.
Specifically the .lib format that VS generates isn't compatible with... anything else. Like wise, the .a and .o formats that mingw generates are not recognisable by VS. So if you want to statically link your binaries, you're stuck using one or the other. (This isn't an SDL limitation; it's a C/C++ limitation) ~ Doug. On Mon, Feb 11, 2013 at 4:56 AM, Taiki wrote:
|
|||||||||||||
|
|
||||||||||||||
|
Spirrwell
|
Actually some libraries work with the .lib format even under MinGW. OpenAL for example have their binaries in .lib format, yet it still works just fine. But that's not the point here, the problem is I can't get SDL 2.0 to link statically and it's acting as though there are other dependencies not yet met like winmm, but linking to it does nothing.
Are there other libraries that need linking to? I mean I absolutely hate having to compile SDL 2.0 and what I've learned is that even with the SDL_image HG doesn't come with everything so perhaps SDL 2.0 doesn't either. I had to download libjpg, zlib, and libpng and build them to get support for those alternate file formats and I still couldn't get png files to work. I can get SDL 2.0 to compile and link just fine both dynamically and statically under Ubuntu 12.04 64 bit. I mean it's just perfect. Is there any projection as to when Windows binaries will be available for SDL 2.0 or when SDL 2.0 will be released officially? |
|||||||||||
|
|
||||||||||||
| Linking SDL Statically |
|
Sik
|
That he mentions the includes makes me think that he imported the
Visual Studio projects (several IDEs can do this) and tried to build it with other toolchains. When I had to do that because I couldn't figure out the proper way to build with MinGW I went into SDL_config_windows.h and started commenting out DirectX support until it built. Not really much of an issue except because the only non-DirectX audio alternative has a 500ms latency :( 2013/2/10, Doug:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
|
||||||||||||||||
|
Taiki
|
Thanks, it worked perfectly without Joystick, Audio and touch support (stuffs I didn't need).
Not my topic but thanks :p |
|||||||||||
|
|
||||||||||||
| Linking SDL Statically |
|
Sik
|
You can still use joysticks without DirectX if you really need later
access to the input it should be enough) 2013/2/11, Taiki:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
|
Spirrwell
|
But I'm still without a solution.
|
|||||||||||
|
|
||||||||||||
|
Taiki
|
Do you need Audio/Jostick/Touch?
If not, statically link with this .a http://www.mediafire.com/?p68hefp8z9lu9kw |
|||||||||||
|
|
||||||||||||
|
Spirrwell
|
Two things. 1. Yes, I need Joystick support and Audio support (assuming that SDL_mixer would make no difference for Audio) 2. Is that the right version? It just says libSDL.a not libSDL2.a |
|||||||||||||
|
|
||||||||||||||
|
Taiki
|
It's built from the SDL2 source code on libsdl.org
For Joystick support, well, this build doesn't contain anything for that =/ |
|||||||||||
|
|
||||||||||||
|
Spirrwell
|
So then how can this be fixed? I mean what's the actual issue with the code that makes it not work?
|
|||||||||||
|
|
||||||||||||
|
Taiki
|
The problem is to include dinput.h
You can try to fix it yourself by commenting stuffs in sdl_config_windows then fix issues in things you need... |
|||||||||||
|
|
||||||||||||

