The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
compile SDL 2.0.3 on windows
sonic


Joined: 15 Sep 2014
Posts: 3
Hello SDL-Community,

I get a strange behaviour when I compile SDL (2.0.3) on my own.
I compiled using CL.exe 18.00.30501 via nmake (Visual Studio Professional 2013) with CMAKE. When I want to compile and link a minimal example I get LNK2019 errors (unresolved symbol) which I can workaround by linking additionally to winmm.lib, imm32.lib and version.lib.
However, when I use the precompiled binaries or the compiled versions via the solution files, it works without these additional dependencies. So there must be something going on in the CMAKE options which I missed.

How can I get rid of these additional dependencies? Can I somehow link them into the library itself via cmake?
Hello
ANTA


Joined: 16 Sep 2014
Posts: 11
maybe just link all windows into your lib ?
Re:Hello
sonic


Joined: 15 Sep 2014
Posts: 3
What do you mean exactly?

I actually found this in CMakeList.txt, line 879-880:
Code:
  # Libraries for Win32 native and MinGW
  list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)


and cmake also gives this output:
Code:
 EXTRA_LIBS:    user32;gdi32;winmm;imm32;ole32;oleaut32;version;uuid;dinput8;dxguid;dxerr


so this should be linked in SDL. but why do I need additional dependencies then?
ANTA


Joined: 16 Sep 2014
Posts: 11
you need it if you non't use SDL.dll
sonic


Joined: 15 Sep 2014
Posts: 3
mhm...maybe you can be a bit more precise?

I tried to link my hello-sdl program to different versions of the library:
1.) compiled by source via cmake/nmake: dependencies needed.
2.) compiled by source via cmake/VS2013 solution files: dependencies needed.
3.) compiled by source via given VS2013 solution files: no dependencies needed.
4.) precompiled libraries: no dependencies needed.

So it must have something to do with the CMAKE compilation/linking process and not with my way how to link.

I simply want to understand in which way the precompiled binaries or the given solution files differ from the cmake-builds.
ANTA


Joined: 16 Sep 2014
Posts: 11
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>

you always need this deps or in SDL.dll or in your APP