- I have build zeroMQ solution i.e libzmq and czmq, I have used cmake-3.13 to configure and generate while vs 2015 to build solution for my Windows 10 system.
- I was able to run czmq_selftest.exe successfully but when I try to run the example code I get the following error-
Here is my directory structure-
C:\Program Files\czmq\examples\security\hello.c C:\Program Files\czmq\include
hello.c
#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 am using "MinGW64" for compiling the above code-
Initially the above code gives me
$ gcc hello.c -o hello hello.c:5:10: fatal error: czmq.h: No such file or directory
While I tried manually giving the header file path I get-
gcc hello.c -o hello -I "C:\Program Files\czmq\include"
C:\Ruby25-x64\msys64\tmp\ccF5oCT1.o:hello.c:(.text+0x22): undefined reference to `__imp_zsock_new_checked'
C:\Ruby25-x64\msys64\tmp\ccF5oCT1.o:hello.c:(.text+0x3b): undefined reference to `__imp_zsock_set_curve_server'
C:\Ruby25-x64\msys64\tmp\ccF5oCT1.o:hello.c:(.text+0x64): undefined reference to `__imp_zsock_destroy_checked'
collect2.exe: error: ld returned 1 exit status
I can't find any information which can help me solve this error.