alex-sector / dns2tcp

GNU General Public License v2.0
178 stars 56 forks source link

Compilation error #2

Closed paolosezart closed 3 years ago

paolosezart commented 4 years ago

I would like to compile a client for win x64. I have Ubuntu 20.04. When trying to compile, it gives an error:

root@denese:~/dns2tcp-0.5.2/client# i686-w64-mingw32-gcc -o main32.exe main.c /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x42): undefined reference to 'get_option' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x51): undefined reference to 'create_socket' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x8a): undefined reference to '_imp__WSACreateEvent@0' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x135): undefined reference to '_imp__WSAEventSelect@12' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x14c): undefined reference to 'list_resources' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x162): undefined reference to 'bind_socket' /usr/bin/i686-w64-mingw32-ld: /tmp/ccH4urwU.o:main.c:(.text+0x171): undefined reference to 'do_client' collect2: error: ld returned 1 exit status

How can this problem be solved?

alex-sector commented 3 years ago

You must use the Makefile. Here is the command line for client cross-compilation :

CC=x86_64-w64-mingw32-gcc CFLAGS="-DGW32" ./configure --host=x86_64-w64-mingw32

cd client ; make

Regards