Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

make WIN64=yes fails on build. (Linux MinGW cross-compile) #100

Closed stan0x closed 3 years ago

stan0x commented 3 years ago

seems to give some erroors in tng_irc.o:tng_irc.c.

also doenst seem to make a .dll file

src/acebot_spawn.o acesrc/bot_env_doors.o acesrc/bot_utility.o acesrc/acebot_compress.o acesrc/bot_ai.o acesrc/bot_movement.o acesrc/bot_weapon.o acesrc/acebot_items.o acesrc/botchat.o acesrc/botnav.o acesrc/acebot_movement.o acesrc/bot_collision.o acesrc/botscan.o /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1c): undefined reference to __imp_socket' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x59): undefined reference toimp_setsockopt' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x80): undefined reference to `imp_htons' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x97): undefined reference to __imp_bind' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xae): undefined reference toimp_listen' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xce): undefined reference to `imp_accept' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xd5): undefined reference to __imp_closesocket' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x11e): undefined reference toimp_recv' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1d1): undefined reference to `imp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1fd): undefined reference to __imp_closesocket' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x229): undefined reference toimp_inet_ntoa' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x25d): undefined reference to __imp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x2e3): undefined reference toimp_WSAStartup' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x550): undefined reference to `imp_htons' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x5d4): undefined reference to __imp_inet_addr' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x681): undefined reference toimp_ntohs' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x691): undefined reference to __imp_inet_ntoa' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x6dc): undefined reference toimp_socket' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x739): undefined reference to `imp_gethostbyname' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x74d): undefined reference to __imp_inet_ntoa' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x76e): undefined reference toimp_connect' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x84f): undefined reference to `imp_ioctlsocket' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x8cd): undefined reference to __imp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xa04): undefined reference toimp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xc3e): undefined reference to `imp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0xdd3): undefined reference to __imp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x129c): undefined reference toimp_send' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x134d): more undefined references to `imp_send' follow /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1acd): undefined reference to __imp_recv' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1c59): undefined reference toimp_WSAGetLastError' /usr/bin/x86_64-w64-mingw32-ld: tng_irc.o:tng_irc.c:(.text+0x1e5e): undefined reference to `imp_send' collect2: error: ld returned 1 exit status make: *** [Makefile:118: gamex86_64.so] Error 1

Raptor007 commented 3 years ago

It should detect your MinGW environment and set WIN32=y automatically, which would add -lws2_32 to the linker step and solve those errors. For now, you should be able to build a 64-bit DLL with make WIN32=y WIN64=y as a workaround.

What does it say when you type uname -s in MinGW? That should tell me what I need to know to fix the Makefile.

(Be aware most Windows q2pro.exe builds are 32-bit, so you may not actually need a 64-bit DLL.)

stan0x commented 3 years ago

I added some to the Makefile. Now it works on 32bit and 64bit. #101

Raptor007 commented 3 years ago

Sorry for the delay! I merged these changes today, and tweaked them so they won't break the build process on Windows MinGW.

https://github.com/Raptor007/aq2-tng/commit/6f4e934bd298b2203f6fb1fb5f9663749d882c2a