Problem with compiling an SDL_Mixer applictation

I’m trying to test the SDL_Mixer library to make sure I can figure out how
to use it (not too difficult it seems), but it seems to be having linker
problems.

I’ve attached the source file and the error file, but I’m not sure why this
is happening (it looks like it cant find the function definitions, even
though I tell it that it is using DLLs).

the command line:

gcc -ISDL test.cpp > out.txt 2>&1

Library Versions:
SDL 1.2.4
SDL_Mixer 1.2.4

The DLLs (precompiled, downloaded from the SDL site) have been copied to
both the ‘bin’ directory and the ‘windows’ directory.

The header files for these libraries were copied into the MinGW include
folder.

Thank you,
-Jim Stapleton

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: out.txt
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020524/60f8dc15/attachment.txt
-------------- next part --------------
A non-text attachment was scrubbed…
Name: test.cpp
Type: application/octet-stream
Size: 2408 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020524/60f8dc15/attachment.obj

After 45 minutes of searching, I got it down this far:

C:/MinGWin/bin/…/lib/gcc-lib/mingw32/2.95.3-7/…/…/…/libmingw32.a(main.o)
(.text+0xaf):main.c: undefined reference to `WinMain at 16’

But I don’t know what causes this problem

(The -ISDL that I saw was shown by someone who helped me before, & I thought
it was a pneumonic for ‘IS-DLL’ and they used that command line, the fact
that 'l’s and 'I’s look alike in this font doesn’t help.)

I appologise for bothering you with all of the other stuff, but I"m still
having problems with the WINMAIN at 16.

-Jim> ----- Original Message -----

From: stapleton.41@osu.edu (Steven James Stapleton)
To:
Sent: Friday, May 24, 2002 2:10 PM
Subject: [SDL] problem with compiling an SDL_Mixer applictation

I’m trying to test the SDL_Mixer library to make sure I can figure out how
to use it (not too difficult it seems), but it seems to be having linker
problems.

I’ve attached the source file and the error file, but I’m not sure why
this
is happening (it looks like it cant find the function definitions, even
though I tell it that it is using DLLs).

the command line:

gcc -ISDL test.cpp > out.txt 2>&1

Library Versions:
SDL 1.2.4
SDL_Mixer 1.2.4

The DLLs (precompiled, downloaded from the SDL site) have been copied to
both the ‘bin’ directory and the ‘windows’ directory.

The header files for these libraries were copied into the MinGW include
folder.

Thank you,
-Jim Stapleton

After 45 minutes of searching, I got it down this far:

C:/MinGWin/bin/…/lib/gcc-lib/mingw32/2.95.3-7/…/…/…/libmingw32.a(main.o)
(.text+0xaf):main.c: undefined reference to `WinMain at 16’

But I don’t know what causes this problem

(The -ISDL that I saw was shown by someone who helped me before, & I thought
it was a pneumonic for ‘IS-DLL’ and they used that command line, the fact
that 'l’s and 'I’s look alike in this font doesn’t help.)

I appologise for bothering you with all of the other stuff, but I"m still
having problems with the WINMAIN at 16.

It’s now in the FAQ:
http://www.libsdl.org/faq.php?action=listentries&category=4#58

Q: I get “undefined reference to `WinMain at 16’”

See ya,
-Sam Lantinga, Software Engineer, Blizzard EntertainmentA: Under Visual C++, you need to link with SDLmain.lib. Under the gcc build environments, you need to link with the output of “sdl-config --libs”.