Ok, I’m out of ideas.
I installed the Mingw32 compiler from
"cross32-linux-x86-glibc-2.1.tar.gz", the DirectX devel binaries and
headers, the works. Then compiled SDL, as instructed in README.Win32.
No problems so far. All the SDL test programs compiled fine (and work on
w9x, although I get visit from Dr Watson under Vmware/NT4). Non-SDL test
programs work even under VMware (DirectX-related?).
When compiling a little test program of my own, with command line
/usr/local/cross-tools/bin/i386-mingw32-gcc -D__WIN32__ -Wall -O2 -I…
-I/usr/local/cross-tools/i386-mingw32/include
-I/usr/local/cross-tools/i386-mingw32/include/SDL -Dmain=SDL_main
…/graffa.cpp kello.cpp taulu.cpp gkello.cpp -o kello.exe
-L/usr/local/cross-tools/i386-mingw32/lib -lmingw32 -lSDLmain -lSDL
-luser32 -lgdi32 -lwinmm -ldxguid -mwindows -lm
I get
/usr/local/cross-tools/i386-mingw32/lib/libSDLmain.a(SDL_main.o): In
function console_main’:
/usr/local/cross-tools/SDL-1.0.8/src/main/SDL_main.c:141: undefined
reference to SDL_main’
make: *** [all] Error 1
“SDL.h” is #included where it matters (file with main() and class with all
the SDL related stuff).
I configured SDL with
./configure --host=i386-linux --target=i386-mingw32
–disable-pthreads --disable-video-cgi --disable-video-svga
–disable-video-fbcon --disable-video-x11 --disable-esd
–disable-shared
Most command line -L/-I-arguments are straigt from Mingw32’s sdl-config, so
they should be in correct order.–
PGP public key available.
Try playing with the order of your “-l” switches.
For example, do -lSDL -lSDLmain, etc…
Rather than your current -lSDLmain -lSDL
I’m not sure if ld is usually that picky, or just the mingw32 ld is more
picky than most, but this seems to be a common problem for most new to
developing in mingw32, including myself.–
Brian
On Mon, 20 Mar 2000 kimmo.veijalainen at pp.inet.fi wrote:
Ok, I’m out of ideas.
I installed the Mingw32 compiler from
"cross32-linux-x86-glibc-2.1.tar.gz", the DirectX devel binaries and
headers, the works. Then compiled SDL, as instructed in README.Win32.
No problems so far. All the SDL test programs compiled fine (and work on
w9x, although I get visit from Dr Watson under Vmware/NT4). Non-SDL test
programs work even under VMware (DirectX-related?).
When compiling a little test program of my own, with command line
/usr/local/cross-tools/bin/i386-mingw32-gcc -D__WIN32__ -Wall -O2 -I…
-I/usr/local/cross-tools/i386-mingw32/include
-I/usr/local/cross-tools/i386-mingw32/include/SDL -Dmain=SDL_main
…/graffa.cpp kello.cpp taulu.cpp gkello.cpp -o kello.exe
-L/usr/local/cross-tools/i386-mingw32/lib -lmingw32 -lSDLmain -lSDL
-luser32 -lgdi32 -lwinmm -ldxguid -mwindows -lm
I get
/usr/local/cross-tools/i386-mingw32/lib/libSDLmain.a(SDL_main.o): In
function console_main’:
/usr/local/cross-tools/SDL-1.0.8/src/main/SDL_main.c:141: undefined
reference to SDL_main’
make: *** [all] Error 1
“SDL.h” is #included where it matters (file with main() and class with all
the SDL related stuff).
I configured SDL with
./configure --host=i386-linux --target=i386-mingw32
–disable-pthreads --disable-video-cgi --disable-video-svga
–disable-video-fbcon --disable-video-x11 --disable-esd
–disable-shared
Most command line -L/-I-arguments are straigt from Mingw32’s sdl-config, so
they should be in correct order.
–
PGP public key available.
Try playing with the order of your “-l” switches.
For example, do -lSDL -lSDLmain, etc…
Rather than your current -lSDLmain -lSDL
If you find the correct order, please post it so I can add it to the FAQ.
Thanks!
-Sam Lantinga (slouken at devolution.com)
Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec
I think this is related to a similar problem mentioned in
the “SDL_main() and main()” messages in this list.> ----- Original Message -----
From: kimmo.veijalainen@pp.inet.fi ()
To:
Sent: Monday, March 20, 2000 5:24 PM
Subject: [SDL] i386-mingw32-gcc / linking problem: SDL_main() not found
Ok, I’m out of ideas.
I installed the Mingw32 compiler from
"cross32-linux-x86-glibc-2.1.tar.gz", the DirectX devel binaries and
headers, the works. Then compiled SDL, as instructed in README.Win32.
No problems so far. All the SDL test programs compiled fine (and work on
w9x, although I get visit from Dr Watson under Vmware/NT4). Non-SDL test
programs work even under VMware (DirectX-related?).
When compiling a little test program of my own, with command line
/usr/local/cross-tools/bin/i386-mingw32-gcc -D__WIN32__ -Wall -O2 -I…
-I/usr/local/cross-tools/i386-mingw32/include
-I/usr/local/cross-tools/i386-mingw32/include/SDL -Dmain=SDL_main
…/graffa.cpp kello.cpp taulu.cpp gkello.cpp -o kello.exe
-L/usr/local/cross-tools/i386-mingw32/lib -lmingw32 -lSDLmain -lSDL
-luser32 -lgdi32 -lwinmm -ldxguid -mwindows -lm
I get
/usr/local/cross-tools/i386-mingw32/lib/libSDLmain.a(SDL_main.o): In
function console_main’:
/usr/local/cross-tools/SDL-1.0.8/src/main/SDL_main.c:141: undefined
reference to SDL_main’
make: *** [all] Error 1
“SDL.h” is #included where it matters (file with main() and class with all
the SDL related stuff).
I configured SDL with
./configure --host=i386-linux --target=i386-mingw32
–disable-pthreads --disable-video-cgi --disable-video-svga
–disable-video-fbcon --disable-video-x11 --disable-esd
–disable-shared
Most command line -L/-I-arguments are straigt from Mingw32’s sdl-config,
so
they should be in correct order.
–
PGP public key available.
The correct flags are -lSDL -lSDLmain -lSDL
Yes, you need SDL twice - SDLmain uses symbols from SDL, and the linker only
goes left-to-right…
Dan