【问题标题】:How to build zeromq with MinGW?如何使用 MinGW 构建 zeromq?
【发布时间】:2014-06-10 18:23:43
【问题描述】:

我已经尝试过官方howto 但失败了。我收到错误: "The procedure entry point InterlockedCompareExchange@12 could not be located in the dynamic link library libstdc++-6.dll"

【问题讨论】:

    标签: dll build mingw zeromq


    【解决方案1】:

    问题是由于旧的 gcc 编译器与 ruby​​installer.org 的 DevKit 捆绑在一起的(我的 PC 上是 4.5 和 4.8)。请改用MSYS。假设我们在D:\libs\zeromq中有zeromq源,那么过程是:

    1. 下载 GUI MinGW 安装程序。
    2. 安装 base 和 MSYS(如果您已经有工作的 gcc 编译器,您可能只需要 MSYS)。
    3. 通过执行 C:\MinGW\msys\1.0\msys.bat 启动 MSYS 环境。
    4. 关注将 MSYS 与 MinGW 一起使用部分:
      1. mount c:/mingw /mingw
      2. cd /d/libs/zeromq
      3. ./configure --prefix=/mingw
      4. make
      5. /d/libs/zeromq/src/.libs/libzmq.dll复制到您想要的位置。

    实际上我需要在 C++ 中使用 ZeroMQ,所以我下载了 zmq.hpp,将其移至包含目录,并编译 hwserver.cpp 进行测试:

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

    它成功了,但是当我启动它时,我得到了:

    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.
    

    我已经设法通过评论第 279、280 行来摆脱这个失败。Similar issue

    【讨论】:

      猜你喜欢
      • 2013-05-11
      • 2013-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多