0

I am trying to get ZeroMQ work on Windows 10 but with no success. I have compiled the dependent libraries using cmake and Visual Studio and it was successfully built.

However I ran into error when trying the example problem and realized there is a linking error, system is unable to locate the header files stored.

I had asked previously about this issue here which partially solved but I still got error, I get error #include <czmq.h> missing when running program

So I tried manually providing the path to gcc and got some wierd error- Here is example code which I used

    #include <czmq.h>

    int main (void) {
     zsock_t *publisher = zsock_new (ZMQ_PUB);
     zsock_set_curve_server (publisher, true);
     puts ("Hello, Curve!");
     zsock_destroy(&publisher);
     return 0;
    }

I compiled the above code using below method-

gcc hello.c -o myapp -lczmq -lzmq -I "C:\Users\P\go\src\github.com\zeromq\czmq\include" -L "C:\Users\P\go\src\github.com\zeromq\czmq\Debug"

As earlier I was getting as missing error and here is the output.

C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\P\go\src\github.com\zeromq\czmq\Debug/czmq.lib when searching for -lczmq
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\P\go\src\github.com\zeromq\czmq\Debug/libczmq.dll when searching for -lczmq
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\P\go\src\github.com\zeromq\czmq\Debug/czmq.lib when searching for -lczmq
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\P\go\src\github.com\zeromq\czmq\Debug/libczmq.dll when searching for -lczmq
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\P\go\src\github.com\zeromq\czmq\Debug\czmq.lib when searching for -lczmq
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lczmq
collect2.exe: error: ld returned 1 exit status

So I am stuck with such simple things which aren't working :( Any suggestion will really be helpful.

gadhvi
  • 97
  • 2
  • 11
  • 1
    your title is wrong, it concerns _czmq.lib_, not _#include _ – bruno Jan 11 '19 at 12:23
  • 1
    _I have compiled the dependent libraries using cmake and Visual Studio_ : cmake used gcc ? Probably the dll was made by Visual Studio – bruno Jan 11 '19 at 12:24
  • 1
    Ok I will edit the question, Yes I used cmake to configure and generate files and the solution was built using Visual Studio , so I got .dll files using VS2015. – gadhvi Jan 11 '19 at 12:38
  • 1
    @gahvi it is worst now, do you understand the difference between a header file and a library file ? – bruno Jan 11 '19 at 12:43
  • My bad, I know the difference but I was confused on how to frame the question. – gadhvi Jan 11 '19 at 13:00
  • 1
    According to [this question](https://stackoverflow.com/questions/3119714/skipping-incompatible-libraries-at-compile), that error means that the library is built for the wrong architecture. Maybe one of them is built for 32-bit, and the other is built for 64 bit. Can you run `file C:\Users\P\go\src\github.com\zeromq\czmq\Debug/czmq.lib` ? – Nick ODell Jan 11 '19 at 17:06
  • @NickODell I executed above command using mingw64 - `/c/Users/P/go/src/github.com/zeromq/czmq/Debug/czmq.lib: current ar archive` – gadhvi Jan 13 '19 at 15:24

0 Answers0