Re: ld.exe: cannot find -lws2_32.lib, -lmswsock.lib, and -lrpcrt4.lib

387 views
Skip to first unread message
Message has been deleted

carlkl

unread,
Mar 25, 2016, 11:00:53 AM3/25/16
to mingwpy, vitaly.kru...@gmail.com
I can't actively assist on this build the next days. However, it seems that the cmake build has som VC-ism semantics and has to be adapted to gcc.  -lws2_32.lib should read -lws2_32 for example. The corresponding import library is then: libws2_32.a. The problem could be the fact that numpy was build with MSVC. It may be necessary to monkeypatch numpy.distutils to play well together with mingwpy.

Am Freitag, 25. März 2016 03:34:29 UTC+1 schrieb vitaly.kru...@gmail.com:
I've been at this all day, googling and experimenting, and am completely stomped. When I build apr-1 (apache portable runtime) wrapped in cmake's ExternalProject_add (https://github.com/vitaly-krugl/nupic.core/blob/add-win32-build/external/Apr1Lib.cmake) as part of my overall app build, it fails as follows (see https://ci.appveyor.com/project/vitaly-krugl/nupic-core/build/0.3.0.45#L5797):

C:/Python27/share/mingwpy/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lws2_32.lib
C:/Python27/share/mingwpy/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lmswsock.lib
C:/Python27/share/mingwpy/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lrpcrt4.lib

When I list `dir C:\Python27\share\mingwpy\i686-w64-mingw32\lib\`, all of the files libws2_32.a, libmswsock.a, and librpcrt4.a are found in that directory. So, something in my environment is interfering with ld.exe's ability to find those files, but what could it be? I can't figure it out for the life of me. 

When I configure apr-1 directly via cmake (without wrapping it in cmake's ExternalProject_add) and build it via `mingw32-make -f Makefile install`, it builds successfully. This confirms that something in my "uber"-build is somehow interfering with with ld.exe's ability to find ws2_32, mswsock, and rpcrt4. However, I have no clue what to look for.

I install mingwpy via `pip.exe install -i https://pypi.anaconda.org/carlkl/simple mingwpy`. I run the builds on both AppVeyor as well as a dedicated Windows Server 2008 32-bit machine, all with the same results.

Please help.

Many thanks,
Vitaly

vital...@gmail.com

unread,
Apr 12, 2016, 8:29:07 PM4/12/16
to mingwpy, vitaly.kru...@gmail.com
This problem went away somehow, and I can no longer reproduce it. Please ignore.
Reply all
Reply to author
Forward
0 new messages