Adding support for mingw-w64 and winpthread

Johannes Pfau via D.gnu d.gnu at puremagic.com
Wed Mar 30 04:44:41 PDT 2016


Am Wed, 30 Mar 2016 08:27:27 +0000
schrieb Vincent R <lol at dlang.org>:

> make[1]: Entering directory 
> '/home/19013692/tmp/wxd/src/Samples/Controls'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory 
> '/home/19013692/tmp/wxd/src/Samples/Controls'
> make -C Dialogs
> make[1]: Entering directory 
> '/home/19013692/tmp/wxd/src/Samples/Dialogs'
> gdc -o ../../bin/Dialogs Dialogs.o -L../.. -lwxd  -lwxc 
> `wx-config --libs` -lstdc++ -lws2_32 -lwsock32
> C:/DEV/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/5.3.0/libgphobos2.a(socket.o):
> In function `_D3std6socket8Protocol17getProtocolByNameMFxAaZb':
> C:\DEV\msys64\home\19013692\tmp2\MINGW-packages\mingw-w64-gcc\src\build-x86_64-w64-mingw32\x86_64-w64-mingw32\libphobos\src/../../../../gcc-5.3.0/libphobos/src/std/socket.d:461:
> undefined reference to `getprotobyname'
> C:/DEV/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/5.3.0/libgphobos2.a(socket.o):
> In function
> `_D3std6socket8Protocol17getProtocolByTypeMFE3std6socket12ProtocolTypeZb':
> C:\DEV\msys64\home\19013692\tmp2\MINGW-packages\mingw-w64-gcc\src\build-x86_64-w64-mingw32\x86_64-w64-mingw32\libphobos\src/../../../../gcc-5.3.0/libphobos/src/std/socket.d:474:
> undefined reference to `getprotobynumber' ...
> 
> As you can see all the missing symbols are from the socket 
> library and that's why I have added locally -lws2_32 -lwsock32 to 
> the config.gcc but it doesn't solve the problem...
> 
> 

Known problem, I'll probably push a fix to master for this soon.
Linking -lws2_32 -lwsock32 is the correct workaround, but the libraries
must be specified in the correct order regarding libphobos IIRC.

Try
gdc -nophoboslib -lws2_32 -lwsock32 -lgphobos2
or
gdc -nophoboslib -lgphobos2 -lws2_32 -lwsock32

One of these should work ;-)


More information about the D.gnu mailing list