[hatari-devel] CMake build system
Thomas Huth
huth at users.berlios.de
Sat Jan 23 18:28:18 CET 2010
On Sat, 23 Jan 2010 16:09:00 +0200
George Nakos <ggn at hol.gr> wrote:
> Hello Thomas,
>
> I'm still running into some problems with cmake build here. Right at
> the end of the build process I get these messages.
>
> CMakeFiles/hatari.dir/file.c.obj:file.c:(.text+0x2b4): undefined
> reference to `select at 20' Linking C executable hatari.exe
> c:/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libmingw32.a(main.o):main.c:(.text+0xd2):
> undefined reference to `WinMain at 16' collect2: ld returned 1 exit
> status make[2]: *** [src/hatari.exe] Error 1
> make[1]: *** [src/CMakeFiles/hatari.dir/all] Error 2
> make: *** [all] Error 2
>
> After some digging I saw that the first error occurs because of
> HAVE_SELECT. To overcome that I went to file.c and changed the line
> that says #if !(HAVE_SELECT) to #if 0 to overcome this.
select() on MinGW... that rings a bell. select is defined in an
optional library there. Could you please try adding the following code
somewhere at the end to src/CMakeLists.txt to see whether this helps:
if(WIN32)
target_link_libraries(hatari ws2_32)
endif(WIN32)
> But the second error has me stumped :/ I haven't seen that one as far
> as I can remember...
That usually means some problems with libSDLmain.a or SDL_main.h... it
overrides the main() function to do some additional magic during
startup.
I guess it happens because you do not link against libSDLmain.a yet.
Could you please try these lines in src/CMakeLists.txt :
if(WIN32)
target_link_libraries(hatari ${SDLMAIN_LIBRARY})
endif(WIN32)
Does it work better in that case?
Thomas
More information about the hatari-devel
mailing list