rominf
rominf

Reputation: 2845

How to build zeromq with MinGW?

I've tried official howto but failed. I got error: "The procedure entry point InterlockedCompareExchange@12 could not be located in the dynamic link library libstdc++-6.dll"

Upvotes: 0

Views: 3343

Answers (1)

rominf
rominf

Reputation: 2845

The problem was due the old gcc compiler, bundled with DevKit from rubyinstaller.org (4.5 vs 4.8 on my PC). Use MSYS instead. Assume we have zeromq source inside D:\libs\zeromq, then the procedure is:

  1. Download GUI MinGW installer.
  2. Install base and MSYS (if you already have working gcc compiler you probably only need MSYS).
  3. Launch MSYS environment by executing C:\MinGW\msys\1.0\msys.bat.
  4. Follow Using MSYS with MinGW section:
    1. mount c:/mingw /mingw
    2. cd /d/libs/zeromq
    3. ./configure --prefix=/mingw
    4. make
    5. Copy /d/libs/zeromq/src/.libs/libzmq.dll to your desired place.

In fact I needed to use ZeroMQ with C++, so I downloaded zmq.hpp, moved it to include directory, and compiled hwserver.cpp to test it:

C:\MinGW\bin\g++.exe -o hwserver hwserver.cpp -L. -lzmq -ID:\libs\zeromq\include

It worked, but when I launch it I got:

Assertion failed!

Program: D:\tmp\zmq\hwserver.exe
File: D:\libs\zeromq\include/zmq.hpp, Line 280

Expression: rc == 0

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I've managed to get rid of this failure by commenting lines 279, 280. Similar issue

Upvotes: 3

Related Questions