The problem with the SDL module is that the configure test doesn't find _main. I don't know why yet, but I have removed the kludge.
configure:1069: checking for SDL - version >= 1.2.0 configure:1190: /mnt/aphraelraid/home/peter/hack/Pike/7.4/build/windows_xp-5.1.2600-x86/smartlink rntcl -o conftest -I/usr/local/include -I/usr/X11R6/include -R/usr/local/lib -L/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lm -lsdl 1>&5 LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main conftest.exe : fatal error LNK1120: 1 unresolved externals CL returned error code 2.
What does the Windows SDL.h look like?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-24 20:25: Subject: SDL-fel
The problem with the SDL module is that the configure test doesn't find _main. I don't know why yet, but I have removed the kludge.
configure:1069: checking for SDL - version >= 1.2.0 configure:1190: /mnt/aphraelraid/home/peter/hack/Pike/7.4/build/windows_xp-5.1.2600-x86/smartlink rntcl -o conftest -I/usr/local/include -I/usr/X11R6/include -R/usr/local/lib -L/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lm -lsdl 1>&5 LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main conftest.exe : fatal error LNK1120: 1 unresolved externals CL returned error code 2.
/ Peter Bortas
Ah-ha! From SDL_main.h:
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
#if defined(WIN32) || defined(_WIN32) || \ (defined(__MWERKS__) && !defined(__BEOS__)) || \ defined(macintosh) || defined(__APPLE__) || \ defined(__SYMBIAN32__) || defined(QWS)
[...]
#define main SDL_main
That could have an adverse effect on the linker's ability to find "main", yes. Try this patch:
Index: configure.in =================================================================== RCS file: /pike/data/cvsroot/Pike/7.4/src/post_modules/SDL/configure.in,v retrieving revision 1.5 diff -u -r1.5 configure.in --- configure.in 2003/03/24 17:41:19 1.5 +++ configure.in 2003/03/24 22:39:13 @@ -66,6 +66,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#define _SDL_main_h 1 #include "SDL.h"
char* @@ -179,6 +180,7 @@ LIBS="$LIBS $SDL_LIBS" AC_TRY_LINK([ #include <stdio.h> +#define _SDL_main_h 1 #include "SDL.h"
int main(int argc, char *argv[])
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-24 21:00: Subject: SDL-fel
What does the Windows SDL.h look like?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Perhaps related to the -lSDLmain and -Dmain=SDL_main magic that SDL does? Without it (in the case of a standalone app) there is is no WinMain method I believe. Does adding
-Dmain=SDL_main and -lSDLmain to the cflags respective libs help? Of course, when you link Pike itself you don't want to use SDLmain most likely (it mainly parses the command line etc).
/ David Hedbor
Previous text:
2003-03-24 20:25: Subject: SDL-fel
The problem with the SDL module is that the configure test doesn't find _main. I don't know why yet, but I have removed the kludge.
configure:1069: checking for SDL - version >= 1.2.0 configure:1190: /mnt/aphraelraid/home/peter/hack/Pike/7.4/build/windows_xp-5.1.2600-x86/smartlink rntcl -o conftest -I/usr/local/include -I/usr/X11R6/include -R/usr/local/lib -L/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lm -lsdl 1>&5 LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main conftest.exe : fatal error LNK1120: 1 unresolved externals CL returned error code 2.
/ Peter Bortas
There is no need for a "WinMain" in any of the other instances of AC_TRY_RUN, an ordinary main() works fine (as is required by the C standard). So there has to be something more to it...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-24 21:05: Subject: SDL-fel
Perhaps related to the -lSDLmain and -Dmain=SDL_main magic that SDL does? Without it (in the case of a standalone app) there is is no WinMain method I believe. Does adding
-Dmain=SDL_main and -lSDLmain to the cflags respective libs help? Of course, when you link Pike itself you don't want to use SDLmain most likely (it mainly parses the command line etc).
/ David Hedbor
Hmm. That's true.
/ David Hedbor
Previous text:
2003-03-24 21:08: Subject: SDL-fel
There is no need for a "WinMain" in any of the other instances of AC_TRY_RUN, an ordinary main() works fine (as is required by the C standard). So there has to be something more to it...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Hm, wait a minute. That command line says
[...]/smartlink rntcl -o conftest -I/usr/[...]
but if I look at the config logs for danae in xenofarm, the commandlines say
[...]/smartlink rntcl -o conftest.exe -I/usr/[...] ^^^^
This looks very fishy. Can I see the complete config.log?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-24 20:25: Subject: SDL-fel
The problem with the SDL module is that the configure test doesn't find _main. I don't know why yet, but I have removed the kludge.
configure:1069: checking for SDL - version >= 1.2.0 configure:1190: /mnt/aphraelraid/home/peter/hack/Pike/7.4/build/windows_xp-5.1.2600-x86/smartlink rntcl -o conftest -I/usr/local/include -I/usr/X11R6/include -R/usr/local/lib -L/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lm -lsdl 1>&5 LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main conftest.exe : fatal error LNK1120: 1 unresolved externals CL returned error code 2.
/ Peter Bortas
http://peter.bortas.org/bin-export/config.log
/ Peter Bortas
Previous text:
2003-03-24 23:12: Subject: SDL-fel
Hm, wait a minute. That command line says
[...]/smartlink rntcl -o conftest -I/usr/[...]
but if I look at the config logs for danae in xenofarm, the commandlines say
[...]/smartlink rntcl -o conftest.exe -I/usr/[...] ^^^^
This looks very fishy. Can I see the complete config.log?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Yeah, I found it in the filesystem on aphrael. I expect the differences are due to you not using a config.cache in this build. It seems to work either way. The real problem was elsewhere (see 9928968).
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-24 23:38: Subject: SDL-fel
http://peter.bortas.org/bin-export/config.log
/ Peter Bortas
pike-devel@lists.lysator.liu.se