SDL Compilation Documentation

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

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,
-AlexOn Sun, Nov 20, 2011 at 6:08 PM, 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

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

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,
-AlexOn Sun, Nov 20, 2011 at 7:25 PM, 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> 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 < toppij at blacktoppstudios.com> 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

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

I’m glad that got you pointed in the right direction :DOn Sun, Nov 20, 2011 at 10:48 PM, 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> 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 < toppij at blacktoppstudios.com> 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> 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 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

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 :smiley:

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

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,
-AlexOn Tue, Nov 22, 2011 at 1:52 PM, 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. :frowning:

On Mon, Nov 21, 2011 at 9:13 AM, Alex Barry <@Alex_Barry> wrote:

I’m glad that got you pointed in the right direction :smiley:

On Sun, Nov 20, 2011 at 10:48 PM, Joseph Toppi < toppij at blacktoppstudios.com> 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> 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 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> 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 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

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. :frowning:

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 :smiley:

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

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”.

The TL;DR – you need to link to various Windows libraries. Google the
function name (without the @ trail). For example “joyGetNumDevs” links
to the msdnhttp://msdn.microsoft.com/en-us/library/windows/desktop/dd757106(v=vs.85).aspx
page.
At the bottom is the name of DLL that has the function. Add -lname to the
link line. For example “joyGetNumDevs” is in “winmm.dll”, so add “-lwinmm”.
Rinse, repeat until all symbols are resolved.

Why: When you use a DLL, these symbols are already resolved (i.e.
someFunction() -> someDLL.dll) at link time, but when you use a static
library, the references are left unresolved. In fact, using a static
library is not any different than just copy/pasting the .c/.o file into
your project – just how you have to use -lSDL to link with SDL, SDL must
do -lsomefile to link against the Windows APIs it uses. Thus if you need
"-lfoo -lSDL" to link, and SDL needs “-lbar -lbaz”, then your link line
should be the concatenation of the two. “-lfoo -lSDL -lbar -lbaz”. Pretty
much every Win32 API has the “@” on the trail due to the so-called
"stdcall" calling convention. The details aren’t important, but when you
see “function at 12”, you can pretty much be sure that it is a Windows
library, so Google it and add it to the link line.

Just scanning the list, you need “winmm32.dll” and “imm32.dll”

Patrick

Every time I am about to give up an move on somebody explains
something and shows me exactly what I need, or should be researching.

I will definitely look into this.

Thank you.On Fri, Nov 25, 2011 at 1:48 PM, Patrick Baggett <baggett.patrick at gmail.com> wrote:

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”.

The TL;DR – ?you need to link to various Windows libraries. Google the
function name (without the @ trail). For example “joyGetNumDevs” links to
the?msdn?page. At the bottom is the name of DLL that has the function. Add
-lname to the link line. For example “joyGetNumDevs” is in “winmm.dll”, so
add “-lwinmm”. Rinse, repeat until all symbols are resolved.
Why:?When you use a DLL, these symbols are already resolved (i.e.
someFunction() -> someDLL.dll) at link time, but when you use a static
library, the references are left unresolved. In fact, using a static library
is not any different than just copy/pasting the .c/.o file into your
project – just how you have to use -lSDL to link with SDL, SDL must do
-lsomefile to link against the Windows APIs it uses. Thus if you need “-lfoo
-lSDL” to link, and SDL needs “-lbar -lbaz”, then your link line should be
the concatenation of the two. “-lfoo -lSDL -lbar -lbaz”. Pretty much every
Win32 API has the “@” on the trail due to the so-called “stdcall” calling
convention. The details aren’t important, but when you see “function at 12”,
you can pretty much be sure that it is a Windows library, so Google it and
add it to the link line.
Just scanning the list, you need “winmm32.dll” and "imm32.dll"
Patrick


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

Every time I am about to give up an move on somebody explains
something and shows me exactly what I need, or should be researching.

I will definitely look into this.

Thank you.

That’s what mailing lists are for. Good luck. :)On Fri, Nov 25, 2011 at 2:23 PM, Joseph Toppi wrote:

Can I see your compile line, like how you’re invoking gcc?
-AlexOn Fri, Nov 25, 2011 at 3:28 PM, Patrick Baggett <baggett.patrick at gmail.com>wrote:

On Fri, Nov 25, 2011 at 2:23 PM, Joseph Toppi <toppij at blacktoppstudios.com wrote:

Every time I am about to give up an move on somebody explains
something and shows me exactly what I need, or should be researching.

I will definitely look into this.

Thank you.

That’s what mailing lists are for. Good luck. :slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I hadn’t realized that the undefined references were to windows system
calls. I also hadn’t realized that in my cmake configuration that it
was ignoring what I had put in the from the output of sdl-config. I
must have done something incorrectly in cmake. After that I looked at
the parts that sdl-config was giving and tried to understand them. I
kept the equivalent of -lSDL -lSDLmain -lwinmm -lImm32 -lVersion and
dropped most of the rest. For reference the complete of “sdl-config
–static-libs” output was “-L/usr/local/lib -lmingw32 -lSDLmain -lSDL
-mwindows -lm -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32
-lversion -luuid”.

This correctly statically linked SDL in this shared library, called
physgame, I was trying to compile. But now when I try to link this
shared library to the end application, called Catch!, I get an error
message. When attempting to build physgame.dll (we had cmake leave off
the ‘lib’) now it also makes a libphysgame.dll.a that it never made
before. Then when compiling Catch! it says that it cannot find -lSDL
or -lSDLmain but this is no-where in the cmake configuration.

So I did a little research and I tried to figure out what was going on
and apparently that is an import library and it is what I should link
against. I guess it has meta data that describes the innards on
physgame.dll. Judging by its size, it likely has all the static SDL
stuff in it too. Now, linking against that import everything works. :slight_smile:

Now, off I to go make this seamless and automated. :slight_smile:

Thanks again everybody!On Fri, Nov 25, 2011 at 2:55 PM, Alex Barry <alex.barry at gmail.com> wrote:

Can I see your compile line, like how you’re invoking gcc?
-Alex

On Fri, Nov 25, 2011 at 3:28 PM, Patrick Baggett <baggett.patrick at gmail.com> wrote:

On Fri, Nov 25, 2011 at 2:23 PM, Joseph Toppi <@Joseph_Toppi> wrote:

Every time I am about to give up an move on somebody explains
something and shows me exactly what I need, or should be researching.

I will definitely look into this.

Thank you.

That’s what mailing lists are for. Good luck. :slight_smile:


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