我正在尝试在Cygwin上安装pyzmq并收到错误。我已经安装了libzmq,它位于/ usr / local / lib目录中。我尝试了所有可能的组合,但一直收到错误(pip,easy_install,从源代码包构建等)。这是我在使用此命令时遇到的错误:
python setup.py install --zmq=/usr/local
/usr/local/lib/libzmq.a(libzmq_la-plain_mechanism.o):plain_mechanism.cpp:(.data+0x0): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-plain_mechanism.o):plain_mechanism.cpp:(.xdata+0x20): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-plain_mechanism.o):plain_mechanism.cpp:(.xdata+0x40): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-plain_mechanism.o):plain_mechanism.cpp:(.xdata+0x108): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-plain_mechanism.o):plain_mechanism.cpp:(.rdata$_ZTIN3zmq17plain_mechanism_tE[_ZTIN3zmq17plain_mechanism_tE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libzmq.a(libzmq_la-v1_encoder.o):v1_encoder.cpp:(.data+0x0): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-v1_encoder.o):v1_encoder.cpp:(.xdata+0x2c): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-v1_encoder.o):v1_encoder.cpp:(.rdata$_ZTIN3zmq14encoder_base_tINS_12v1_encoder_tEEE[_ZTIN3zmq14encoder_base_tINS_12v1_encoder_tEEE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libzmq.a(libzmq_la-v1_encoder.o):v1_encoder.cpp:(.rdata$_ZTIN3zmq12v1_encoder_tE[_ZTIN3zmq12v1_encoder_tE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.data+0x0): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.xdata+0x10): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.xdata+0x5c): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.rdata$_ZTIN3zmq14decoder_base_tINS_12v1_decoder_tEEE[_ZTIN3zmq14decoder_base_tINS_12v1_decoder_tEEE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.rdata$_ZTIN3zmq12v1_decoder_tE[_ZTIN3zmq12v1_decoder_tE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/local/lib/libzmq.a(libzmq_la-v1_decoder.o):v1_decoder.cpp:(.rdata$_ZTVN3zmq14decoder_base_tINS_12v1_decoder_tEEE[_ZTVN3zmq14decoder_base_tINS_12v1_decoder_tEEE]+0x30): undefined reference to `__cxa_pure_virtual'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o): In function `std::string::_Rep::_M_dispose(std::allocator<char> const&)':
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/bits/basic_string.h:249: undefined reference to `std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o): In function `zmq::null_mechanism_t::null_mechanism_t(zmq::session_base_t*, std::string const&, zmq::options_t const&)':
/cygdrive/e/zeromq-4.0.4/src/null_mechanism.cpp:45: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o): In function `~basic_string':
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/bits/basic_string.h:539: undefined reference to `std::string::_Rep::_M_dispose(std::allocator<char> const&)'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o):null_mechanism.cpp:(.data+0x0): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o):null_mechanism.cpp:(.xdata+0x30): undefined reference to `__gxx_personality_seh0'
/usr/local/lib/libzmq.a(libzmq_la-null_mechanism.o):null_mechanism.cpp:(.rdata$_ZTIN3zmq16null_mechanism_tE[_ZTIN3zmq16null_mechanism_tE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../lib/libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0x0): undefined reference to `operator new(unsigned long)'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../lib/libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0x10): undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../lib/libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0x20): undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../lib/libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0x30): undefined reference to `operator delete(void*, std::nothrow_t const&)'
collect2: error: ld returned 1 exit status
error: command 'GCC' failed with exit status 1
Fatal: Falling back on bundled libzmq, but setup.cfg has explicitly prohibited building the libzmq extension.
}
答案 0 :(得分:0)
首先检查此路径是否存在:
/usr/local/lib/pkgconfig/libzmq.pc
如果没有,那么您要么将zmq安装在其他位置,要么需要再次构建它。如果是的话:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
pip install pyzmq