IFL-CAMP / simple

S.I.M.P.L.E. - Smart Intuitive Messaging Platform with Less Effort. A Cross-Platform C++ Library to Exchange Data Across Network.
Mozilla Public License 2.0
22 stars 5 forks source link

simple-static on Windows 10 - ZeroMQ requires ws2_32 and Iphlpapi #45

Closed joebedard closed 6 years ago

joebedard commented 6 years ago

I'm using simple-static in my IDP project (also within CAMP). It seems that ZeroMQ on Windows 10 also requires linking to ws2_32 and Iphlpapi. In my project's CMakeLists.txt, I added ws2_32 and Iphlpapi to target_link_libraries like this:

target_link_libraries(${PROJECT_NAME}
      ${OpenCV_LIBS}
      ${EIGEN3_LIBS}
      ws2_32 #ZeroMQ dependency
      Iphlpapi #ZeroMQ dependency
      simple::simple-static
   )

I followed your install guide (https://github.com/IFL-CAMP/simple/wiki/install:-windows) for ZeroMQ and set ENABLE_CURVE off.

Consider updating the usage page (https://github.com/IFL-CAMP/simple/wiki#cmake) with ws2_32 and Iphlpapi.

My system information: Windows 10 Home, Version 1803 Visual Studio Community 2017, Version 15.6.0 CMake 3.11.2, using generator for Visual Studio 15 2017 Win64

SalvoVirga commented 6 years ago

That is very strange, since the CI runs for VS15 as well. And I also never experienced that on Windows 10. Do you maybe use Windows 10 32-bit? Also that "ws2_32" suggests it.

joebedard commented 6 years ago

Everything is 64-bit. I'm using Windows SDK 10.0.16299.0. Without ws2_32 and Iphlpapi, I get link errors such as:

2>libzmq-v141-mt-s-4_2_3.lib(zmq.obj) : error LNK2019: unresolved external symbol __WSAFDIsSet referenced in function zmq_poll
2>libzmq-v141-mt-s-4_2_3.lib(socket_poller.obj) : error LNK2001: unresolved external symbol __WSAFDIsSet
2>libzmq-v141-mt-s-4_2_3.lib(select.obj) : error LNK2001: unresolved external symbol __WSAFDIsSet
SalvoVirga commented 6 years ago

Oh wait! Are you using libzmq 4.2.3 (I'm guessing from the name of the lib files)? simple required ZeroMQ 4.2.4+!

joebedard commented 6 years ago

Ah! Yes I was. Thanks for catching that!