OpenArena / engine

OpenArena modifications to the ioquake3 engine
http://openarena.ws
GNU General Public License v2.0
212 stars 50 forks source link

Windows version with XMP cannot be compiled as a static linked binary #32

Open sago007 opened 7 years ago

sago007 commented 7 years ago

Currently the Windows nightly builds (http://openarena.ws/board/index.php?topic=5263.0) are compiled without XMP support.

The nightly build are compiled with static linking in an MXE environment.

I have constructed a Docker image with a static version of libxmp-lite but I get the following linker errors:

LD build/release-mingw32-x86/openarena.x86.exe
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x19fb): undefined reference to `_imp__xmp_get_frame_info'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x1a11): undefined reference to `_imp__xmp_get_module_info'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x1a5d): undefined reference to `_imp__xmp_play_buffer'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x1ce5): undefined reference to `_imp__xmp_end_player'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x1cf3): undefined reference to `_imp__xmp_release_module'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x1d01): undefined reference to `_imp__xmp_free_context'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x234a): undefined reference to `_imp__xmp_create_context'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x2364): undefined reference to `_imp__xmp_load_module_from_memory'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x242b): undefined reference to `_imp__xmp_start_player'
/tmp/ccX69R76.ltrans4.ltrans.o:<artificial>:(.text+0x2445): undefined reference to `_imp__xmp_get_module_info'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(control.o): In function `xmp_free_context':
/tmp/libxmp-lite-4.4.1/src/control.c:57: undefined reference to `_imp__xmp_release_module'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(load.o): In function `xmp_release_module':
/tmp/libxmp-lite-4.4.1/src/load.c:604: undefined reference to `_imp__xmp_end_player'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(format.o): In function `format_list':
/tmp/libxmp-lite-4.4.1/src/format.c:62: undefined reference to `xm_loader'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(format.o):format.c:(.rdata+0x0): undefined reference to `xm_loader'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(format.o):format.c:(.rdata+0x8): undefined reference to `it_loader'
/usr/lib/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.3/../../../../i686-w64-mingw32.static/lib/../lib/libxmp.a(format.o):format.c:(.rdata+0xc): undefined reference to `s3m_loader'
collect2: error: ld returned 1 exit status

As far as I can see the "_imp__" means that the binary expect to be linked against a DLL instead.

The solution likely involves a strategic placed "#define" somewhere.