I was working on this exact problem today. As it turned out, the reason I was getting all the ‘undefined reference to
SDL_…’ was because it was linking the wrong libSDL.a I played it ‘safe’ and downloaded the prebuild libSDL.a and
linked it to that and it got rid of all those ‘undefined references.’
For the last error, undefined reference to WinMain at 16, I had to replace the main in my program from:
int main(int argc, char *argv)
to
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
Hope that helps you, now, can anyone help me?
And that got rid of that error, so finally it compiled. Unfortunately I ran into a new problem I am currently trying to
figure out. When I run my compiled executable, I get the following error:
video memory protecting (this line only shows up in WINE)
CreateWindowEx32A: bad class name 0000 (this line only shows up in WINE)
Initialization failed: Couldn’t create window (shows up in WINE and Win98)
Enzo wrote:> Ok, I’m back…
I successfully unpacked cross-compiler (cross32-linux-x86-glibc-2.1.tar.gz)
in /usr/local, directx sources(directx.tar.gz) and binaries
(directx-cross.tar.gz)
then I set PATH=/usr/local/cross-tools/i386-mingw32/bin:$PATH
I changed dir in SDL-1.0.0 and I typed
./configure
make
make install
and always has been processed successfully.
(I also configured ld.so.conf and ldconfig for /usr/local/lib)
now I changed dir in SDL-1.0.0/test and I typed ‘./configure’
loading cache ./config.cache
checking for a BSD compatible install… (cached) /usr/bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… (cached) yes
checking for working aclocal… found
checking for working autoconf… found
checking for working automake… found
checking for working autoheader… found
checking for working makeinfo… found
checking for gcc… (cached) gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… yes
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for working const… (cached) yes
checking for sdl-config… (cached) /usr/local/bin/sdl-config
checking for SDL - version >= 1.0.0… cross compiling; assumed OK… yes
creating ./config.status
creating Makefile
but when I typed ‘make’ this was the output
gcc -g -O2 -I/usr/local/include -D_REENTRANT -o checkkeys checkkeys.o
-L/usr/local/lib -lSDL -lpthread
/usr/local/cross-tools/lib/gcc-lib/i386-mingw32/2.95.2/…/…/…/…/i386-mingw32/bin/ld:
cannot open -lpthread: No such file or directory
make: *** [checkkeys] Error 1
I edited Makefile and I tried to remove -lpthread arguments
the output was:
gcc -g -O2 -I/usr/local/include -D_REENTRANT -o checkkeys checkkeys.o
-L/usr/local/lib -lSDL
checkkeys.o: In function PrintKey': /home/enzo/SDL-1.0.0/test/checkkeys.c:17: undefined reference to
SDL_GetKeyName’
checkkeys.o: In function SDL_main': /home/enzo/SDL-1.0.0/test/checkkeys.c:48: undefined reference to
SDL_Init’
/home/enzo/SDL-1.0.0/test/checkkeys.c:49: undefined reference to
SDL_GetError' /home/enzo/SDL-1.0.0/test/checkkeys.c:52: undefined reference to
SDL_Quit’
/home/enzo/SDL-1.0.0/test/checkkeys.c:55: undefined reference to
SDL_SetVideoMode' /home/enzo/SDL-1.0.0/test/checkkeys.c:56: undefined reference to
SDL_GetError’
/home/enzo/SDL-1.0.0/test/checkkeys.c:62: undefined reference to
SDL_EnableUNICODE' /home/enzo/SDL-1.0.0/test/checkkeys.c:68: undefined reference to
SDL_WaitEvent’
/usr/local/cross-tools/lib/gcc-lib/i386-mingw32/2.95.2/…/…/…/…/i386-mingw32/lib/libmingw32.a(main.o)(.text+0x7f):
undefined reference to `WinMain at 16’
make: *** [checkkeys] Error 1
uh, what’s my error ?
Thanks
bye
Enzo
–
-= aaron p. matthews
-= rival entertainment
-= http://www.Nayzak.com/~jerryma/rival