zeromq / zwssock

ZeroMQ WebSocket library for CZMQ
Mozilla Public License 2.0
88 stars 35 forks source link

Could not compile VS2017/Win10 #18

Open sgluss opened 6 years ago

sgluss commented 6 years ago

I get these errors trying to build ZWSSOCK in X64/Release config:

Severity Code Description Project File Line Suppression State Error LNK1120 9 unresolved externals CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\x64\Release\CZMQ-ZWSSock.exe 1
Error LNK2001 unresolved external symbol imp_zmq_poll CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol
imp_zmq_send CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol imp_zmq_version CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\main.obj 1
Error LNK2001 unresolved external symbol
imp_zsocket_bind CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol imp_zsocket_connect CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol
imp_zsocket_new CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol imp_zsocket_sendmem CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol
imp_zsocket_unbind CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zthread_fork CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1

My linker configuration: C:\czmq\libzmq\bin\x64\Release\v141\static\libzmq.lib C:\czmq\czmq\bin\x64\Release\v141\dynamic\libczmq.lib C:\czmq\zlib-1.2.11\contrib\vstudio\vc14\x64\ZlibStatRelease\zlibstat.lib %(AdditionalDependencies)

sgluss commented 6 years ago

I've tried all kinds of build configurations, nothing has gotten me closer than this.

bluca commented 6 years ago

Make sure you are using CZMQ not newer than 3.x - IE at most https://github.com/zeromq/czmq/releases/tag/v3.0.2

This project uses old 3.x APIs of CZMQ, which were deprecated and removed starting with version 4.0, and that's why you are seeing those build errors I assume.

sgluss commented 6 years ago

I was able to build with latest CZMQ/LibZMQ on ubuntu 16.04, I made these changes to fix the compatibility issues:

https://github.com/zeromq/zwssock/pull/19

sgluss commented 6 years ago

It seems to me to be a linker/include path issue, it is not clear how to resolve the dependencies in Visual Studio though