Dennis Schridde schreef: > Am Donnerstag, 28. Dezember 2006 12:07 schrieb Dennis Schridde: > >> Am Donnerstag, 28. Dezember 2006 02:17 schrieb Giel van Schijndel: >> >>>> A line like >>>> -ljpeg -lpng -lz -lmad -lvorbisfile -lvorbis -logg -lphysfs -lSDLmain >>>> -lSDL -lSDL_net -lGLU -lGL -lopenal works here (Linux/Makefile.raw) >>>> >>>> On Windows it would look like >>>> -ljpeg -lpng -lz -lmad -lvorbisfile -lvorbis -logg -lphysfs -lSDLmain >>>> -lSDL -lSDL_net -lmingw32 -lwsock32 -lwinmm -lglu32 -lopengl32 >>>> -lopenal32 >>>> >>>> That way the wsock and winmm stuff would still be linked before SDL... >>>> >>> Actually ^^ that way (the windows command line you've provided) causes >>> wsock and winmm to be linked *after* SDL, which is exactly how it should >>> be. >>> >>> Currently, however, it looks like this on windows: >>> >>>> -lwsock32 -lwinmm -lglu32 -lopengl32 -lopenal32 -ljpeg -lpng -lz -lmad >>>> -lvorbisfile -lvorbis -logg -lphysfs -lSDLmain -lSDL -lSDL_net >>>> >>> So to acquire the line you've got you'd have to swap the global and the >>> if(windows) section. This however would still require another >>> if(windows) section (before the global one) since -lmingw32 needs to be >>> the first lib specified, otherwise linking will fail with unsatisfied >>> references to '[EMAIL PROTECTED]'. >>> >>> So as long as you make sure that the output set of libs is in this order >>> >>> it should link: >>> >>>> -lmingw32 -ljpeg -lpng -lz -lmad -lvorbisfile -lvorbis -logg -lphysfs >>>> -lSDLmain -lSDL -lSDL_net -lwsock32 -lwinmm -lglu32 -lopengl32 >>>> -lopenal32 >>>> >> Doesn't GCC link "from behind"? Means that it links the libs specified last >> in the commandline first? >> Now I am confused... ;) >> AFAIK gcc simply runs from left to right, creating a symbol table (of required symbols) on its way, and dropping all unreferenced symbols from memory. This means that you will need to provide the library (or linker object) that satisfies a dependency after the linker object that depends on it.
But then again that's just what I've learned, it isn't holy or something similar. > PS: > In the automake build > LIBS="${LIBS} ${WZ_LIBS} ${WIN32_LIBS}" > is used, so the WIN32 libs are at the end, so they are linked first. > > They are set as > WIN32_LIBS="-lwsock32 -lwinmm" > (Without -lmingw32) > > Apparently the Windows compiles I did with this script work. How come??? > > According to you it shouldn't even have compiled... > That it runs is even more interesting... Honestly, I don't why it does link for you, but doesn't link for me (i.e. without libmingw32). -- Giel
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev