【问题标题】:zeromq library cross compile configure err, unsupported system :elfzeromq 库交叉编译配置错误,不支持的系统:elf
【发布时间】:2014-05-23 06:02:54
【问题描述】:

我正在尝试在 MIPS 平台上交叉编译 Zeromq 库。 2.2、3.2.4、4.0.4都试过了,都没有通过配置检查

设置了环境变量CC、CPP、CXX、LD、AR、RANLIB。 然后我运行 ./configure --host=mips

Linux 内核:2.6.31
gcc 版本:4.3.3

checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether the C compiler works... yes
checking whether we are using Intel C compiler... no
checking whether we are using Sun Studio C compiler... no
checking whether we are using clang C compiler... no
checking whether we are using gcc >= 4 C compiler... yes
checking whether the C++ compiler works... yes
checking whether we are using Intel C++ compiler... no
checking whether we are using Sun Studio C++ compiler... no
checking whether we are using clang C++ compiler... no
checking whether we are using gcc >= 4 C++ compiler... yes
checking whether to enable debugging information... no
checking whether to enable code coverage... no
checking for pthread_create in -lpthread... yes
checking for clock_gettime in -lrt... yes
configure: error: unsupported system: elf

【问题讨论】:

    标签: linux mips cross-compiling zeromq toolchain


    【解决方案1】:

    首先,如果出现错误,请禁用 epoll

    功能未实现 (epoll.cpp:41)

    中止

    配置前

    导出 CXXFLAGS=-DZMQ_FORCE_POLL

    开始交叉编译

    使用

    ./configure --host=mips-linux

    输入make时可能会出错

    make[1]: Leaving directory `/home/justinyu/Development/project/askey_cc/zeromq-3.2.4'                                                                       
    justinyu@justinyu-ubuntu:~/Development/project/askey_cc/zeromq-3.2.4$ make
    Making all in src 
    make[1]: Entering directory `/home/justinyu/Development/project/askey_cc/zeromq-3.2.4/src'
    make  all-am
    make[2]: Entering directory `/home/justinyu/Development/project/askey_cc/zeromq-3.2.4/src'
      CXX    libzmq_la-address.lo
      CXX    libzmq_la-clock.lo
      CXX    libzmq_la-ctx.lo
    In file included from ctx.hpp:31,
                     from ctx.cpp:32:
    array.hpp:142:41: error: macro "index" requires 2 arguments, but only 1 given
    In file included from ctx.hpp:31,
                     from ctx.cpp:32:
    array.hpp:142: error: function definition does not declare parameters
    make[2]: *** [libzmq_la-ctx.lo] Error 1
    make[2]: Leaving directory `/home/justinyu/Development/project/askey_cc/zeromq-3.2.4/src'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/home/justinyu/Development/project/askey_cc/zeromq-3.2.4/src'
    make: *** [all-recursive] Error 1
    

    通过在 array.hpp 中添加一些行来修复它

    #ifdef index
    #undef index
    #endif
    
    #ifndef __ZMQ_ARRAY_INCLUDED__
    #define __ZMQ_ARRAY_INCLUDED__
    
    #include <vector>
    #include <algorithm>
    
    namespace zmq 
    {
    

    【讨论】:

      猜你喜欢
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-18
      • 1970-01-01
      • 2020-12-15
      • 1970-01-01
      相关资源
      最近更新 更多