Alex,
First, Thank you for your consistently clever and fresh ideas.
Those options definitely changed how SDL compiled and made it
output only a few small files, and one of them looks likes a static
library.
When I perform a make install
and try to link against the
libraries installed in /usr/local/lib/ (C:\mingw\mysys\1.0\local\lib)
it always seems to not find SDL, but finds SDLmain. When I don’t run
make install and copy the files where the build process for this
project takes over, it finds SDL buts gets the following undefined
references during linking. The same process works fine on Linux
though.
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_mmjoystick.o)||In
function `SDL_SYS_JoystickInit':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\joystick\windows\SDL_mmjoystick.c|161|undefined
reference to `joyGetNumDevs at 0'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\joystick\windows\SDL_mmjoystick.c|166|undefined
reference to `joyGetPosEx at 8'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\joystick\windows\SDL_mmjoystick.c|168|undefined
reference to `joyGetDevCapsW at 12'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_mmjoystick.o)||In
function `SDL_SYS_JoystickUpdate':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\joystick\windows\SDL_mmjoystick.c|300|undefined
reference to `joyGetPosEx at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_systimer.o)||In
function `SDL_StartTicks':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\timer\windows\SDL_systimer.c|63|undefined
reference to `timeBeginPeriod at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\timer\windows\SDL_systimer.c|64|undefined
reference to `timeGetTime at 0'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_systimer.o)||In
function `SDL_GetTicks':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\timer\windows\SDL_systimer.c|89|undefined
reference to `timeGetTime at 0'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetId':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|551|undefined
reference to `ImmGetIMEFileNameA at 12'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|566|undefined
reference to `GetFileVersionInfoSizeA at 8'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|570|undefined
reference to `GetFileVersionInfoA at 16'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|571|undefined
reference to `VerQueryValueA at 16'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_SetupAPI':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|617|undefined
reference to `ImmGetIMEFileNameA at 12'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|630|undefined
reference to `ImmGetContext at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|633|undefined
reference to `ImmReleaseContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_ClearComposition':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|683|undefined
reference to `ImmGetContext at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|687|undefined
reference to `ImmNotifyIME at 16'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|691|undefined
reference to `ImmNotifyIME at 16'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|692|undefined
reference to `ImmReleaseContext at 8'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|689|undefined
reference to `ImmSetCompositionStringW at 24'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_Disable':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|367|undefined
reference to `ImmAssociateContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_Init':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|326|undefined
reference to `ImmGetContext at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|327|undefined
reference to `ImmReleaseContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_Quit':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|381|undefined
reference to `ImmAssociateContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_Enable':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|352|undefined
reference to `ImmAssociateContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_HandleMessage':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|854|undefined
reference to `ImmGetContext at 4'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetCompositionString':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|699|undefined
reference to `ImmGetCompositionStringW at 16'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|704|undefined
reference to `ImmGetCompositionStringW at 16'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_HandleMessage':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|892|undefined
reference to `ImmReleaseContext at 8'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|887|undefined
reference to `ImmGetContext at 4'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetCandidateList':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|766|undefined
reference to `ImmGetCandidateListW at 16'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetCompositionString':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|699|undefined
reference to `ImmGetCompositionStringW at 16'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|704|undefined
reference to `ImmGetCompositionStringW at 16'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetReadingString':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|425|undefined
reference to `ImmGetContext at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|498|undefined
reference to `ImmReleaseContext at 8'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_windowskeyboard.o)||In
function `IME_GetCandidateList':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\video\windows\SDL_windowskeyboard.c|770|undefined
reference to `ImmGetCandidateListW at 16'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_winmm.o)||In
function `WINMM_CloseDevice':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|185|undefined
reference to `waveInClose at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|190|undefined
reference to `waveOutClose at 4'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|197|undefined
reference to `waveOutUnprepareHeader at 12'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|197|undefined
reference to `waveOutUnprepareHeader at 12'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_winmm.o)||In
function `WINMM_PlayDevice':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|144|undefined
reference to `waveOutWrite at 12'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_winmm.o)||In
function `DetectWaveInDevs':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|55|undefined
reference to `waveInGetNumDevs at 0'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|55|undefined
reference to `waveInGetDevCapsW at 12'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_winmm.o)||In
function `DetectWaveOutDevs':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|54|undefined
reference to `waveOutGetNumDevs at 0'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|54|undefined
reference to `waveOutGetDevCapsW at 12'|
C:\Physgame\physgameengine\data\windows\sdl\libSDL.a(SDL_winmm.o)||In
function `WINMM_OpenDevice':|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|228|undefined
reference to `waveInGetNumDevs at 0'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|231|undefined
reference to `waveInGetDevCapsW at 12'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|241|undefined
reference to `waveOutGetNumDevs at 0'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|244|undefined
reference to `waveOutGetDevCapsW at 12'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|320|undefined
reference to `waveInOpen at 24'|
c:\Physgame\physgameengine\libincludes\common\sdlsrc\SDLbuild\src\audio\winmm\SDL_winmm.c|378|undefined
reference to `waveOutPrepareHeader at 12'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
Dynamic linking with a similar copy process also just works on windows
and Linux. I also ran a number of other experiments. The output from
make install
will not be linked against no matter where I put it,
even though there is a libSDL.a and it is a folder that the manually
copied libSDL.a was in, the linker will produce “could not find
-lSDL”.
I highly doubt this is a compiler issue (unless it is some kind of
bug), I installed this copy of windows just before I started working
on this, and I installed the compiler and other tools manually after
the install. Despite this I will try re-installing the compiler before
my next reply.
Any further Ideas would be appreciated, but if no more surface I will
just have to deal with moving around a shared lib just for the windows
build.On Tue, Nov 22, 2011 at 12:56 PM, Alex Barry <alex.barry at gmail.com> wrote:
From SDL, try this:
$ make uninstall
$ make clean
$ ./configure --disable-shared --enable-static
$ make
$ make install
That should clean up your shared sdl.dll file, and force the compiler to use
the static one (afaik, LD tries to find a shared version of the library
first, then if it fails, it tries for a static version).
I hope that helps,
-Alex
On Tue, Nov 22, 2011 at 1:52 PM, Joseph Toppi <@Joseph_Toppi> wrote:
Even after using the options that the script emitted I could not get
static linking working. The compiler kept creating a libsdl.dll.a or
an sdl.dll in the output directory and the resulting binaries did not
work without it.
So I switched it to dynamic linking and I configured our build system
to copy sdl.dll around where it needs to go.
Unless you have any other ideas, I will call that good enough for now
and move onto my next problem.
On Mon, Nov 21, 2011 at 9:13 AM, Alex Barry <alex.barry at gmail.com> wrote:
I’m glad that got you pointed in the right direction
On Sun, Nov 20, 2011 at 10:48 PM, Joseph Toppi <@Joseph_Toppi> wrote:
That definitely helps. I found the sdl-config script and I took a look
inside. I noticed it has an option for static linking, I will
experiment with that too.
On Sun, Nov 20, 2011 at 8:03 PM, Alex Barry <alex.barry at gmail.com> wrote:
When you’re compiling a program using SDL, instead of doing -lSDL, do
sdl-config --libs
and sdl-config --cflags
for the linking
libraries
and
include files, respectively.
I hope that helps,
-Alex
On Sun, Nov 20, 2011 at 7:25 PM, Joseph Toppi <@Joseph_Toppi> wrote:
Alex, et al.
? When I leave out the ./autogen.sh it does compile for me, but then
when I link to libsdl.a I get undefined references to platform
specific items. When I compile with ./autogen.sh I get much more
convoluted errors, but it seems to disable every feature (even
size_t
and size integer support).
? Ignoring the autogen.sh for now, maybe I am linking to wrong
library? On the Linux side all I need to do is link against the
static
lib originally located at “build/.libs/libSDL.a”. I do have to move
it
for some other technical reasons in this project. Could moving it be
affecting something?
On Sun, Nov 20, 2011 at 5:27 PM, Alex Barry <alex.barry at gmail.com> wrote:
Hi Joseph,
I’m also a MinGW and msys user, and SDL compiled fine with just
doing:
$ ./configure
$ make
$ make install
(That should work for both SDL 1.2 and 1.3).
Otherwise, if you have the time, you may have accidently mucked up
your
MinGW install - try re-installing or installing in a different
directory
and
compiling SDL and see if that works.
Take care,
-Alex
On Sun, Nov 20, 2011 at 6:08 PM, Joseph Toppi <@Joseph_Toppi> wrote:
Is there any centralized place where information about
compilation
configuration options that SDL uses? I have been trying to get
SDL
to
compile with MinGW and Msys for a while and I have tried a
passing a
variety of CFLAGS and LDFLAGS to the configure script. I was
wondering
what other documentation was available, before I asked about my
specific issue.
–
–
- Joe Toppi
(402) 714-7539
BlackTopp Studios Inc.
Lead Software Developer
Toppij at BlackToppStudios.com
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
–
- Joe Toppi
(402) 714-7539
BlackTopp Studios Inc.
Lead Software Developer
Toppij at BlackToppStudios.com
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
–
- Joe Toppi
(402) 714-7539
BlackTopp Studios Inc.
Lead Software Developer
Toppij at BlackToppStudios.com
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
–
- Joe Toppi
(402) 714-7539
BlackTopp Studios Inc.
Lead Software Developer
Toppij at BlackToppStudios.com
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
–
- Joe Toppi
(402) 714-7539
BlackTopp Studios Inc.
Lead Software Developer
Toppij at BlackToppStudios.com