zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.97k stars 757 forks source link

Compilation fails during linking unit_tests on ARM #430

Closed sinaaghli closed 4 years ago

sinaaghli commented 4 years ago

I'm trying to compile cppzmq on RPI3 and it fails to link unit_tests, here is the compilation output. Any feedback is appreciated

Scanning dependencies of target catch [ 4%] Creating directories for 'catch' [ 9%] Performing download step (download and verify) for 'catch' -- Downloading... dst='/home/pi/code/cppzmq/build/catch/src/catch.hpp' timeout='none' -- Using src='https://raw.githubusercontent.com/catchorg/Catch2/Catch1.x/single_include/catch.hpp' -- [download 0% complete] -- [download 1% complete] -- [download 2% complete] -- [download 3% complete] -- [download 4% complete] -- [download 5% complete] -- [download 6% complete] -- [download 7% complete] -- [download 8% complete] -- [download 9% complete] -- [download 10% complete] -- [download 11% complete] -- [download 12% complete] -- [download 13% complete] -- [download 14% complete] -- [download 15% complete] -- [download 16% complete] -- [download 17% complete] -- [download 18% complete] -- [download 19% complete] -- [download 20% complete] -- [download 21% complete] -- [download 22% complete] -- [download 23% complete] -- [download 24% complete] -- [download 25% complete] -- [download 26% complete] -- [download 27% complete] -- [download 28% complete] -- [download 29% complete] -- [download 30% complete] -- [download 31% complete] -- [download 32% complete] -- [download 33% complete] -- [download 34% complete] -- [download 35% complete] -- [download 36% complete] -- [download 37% complete] -- [download 38% complete] -- [download 39% complete] -- [download 40% complete] -- [download 41% complete] -- [download 42% complete] -- [download 43% complete] -- [download 44% complete] -- [download 45% complete] -- [download 46% complete] -- [download 47% complete] -- [download 48% complete] -- [download 49% complete] -- [download 50% complete] -- [download 51% complete] -- [download 55% complete] -- [download 59% complete] -- [download 63% complete] -- [download 67% complete] -- [download 70% complete] -- [download 74% complete] -- [download 78% complete] -- [download 82% complete] -- [download 86% complete] -- [download 90% complete] -- [download 94% complete] -- [download 97% complete] -- [download 100% complete] -- Downloading... done [ 18%] No update step for 'catch' [ 18%] No patch step for 'catch' [ 22%] No configure step for 'catch' [ 27%] No build step for 'catch' [ 31%] No install step for 'catch' [ 36%] No test step for 'catch' [ 40%] Completed 'catch' [ 40%] Built target catch Scanning dependencies of target unit_tests [ 54%] Building CXX object tests/CMakeFiles/unit_tests.dir/message.cpp.o [ 54%] Building CXX object tests/CMakeFiles/unit_tests.dir/context.cpp.o [ 54%] Building CXX object tests/CMakeFiles/unit_tests.dir/buffer.cpp.o [ 59%] Building CXX object tests/CMakeFiles/unit_tests.dir/socket.cpp.o [ 63%] Building CXX object tests/CMakeFiles/unit_tests.dir/socket_ref.cpp.o /home/pi/code/cppzmq/tests/socket.cpp: In function ‘void C_A_T_C_HT_E_S_T__26()’: /home/pi/code/cppzmq/tests/socket.cpp:215:34: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations] const bool res = s.recv(&rmsg); ^ In file included from /home/pi/code/cppzmq/tests/socket.cpp:2: /home/pi/code/cppzmq/zmq.hpp:1373:10: note: declared here bool recv(message_t msg, int flags = 0) ^~~~ [ 68%] Building CXX object tests/CMakeFiles/unit_tests.dir/poller.cpp.o [ 72%] Building CXX object tests/CMakeFiles/unit_tests.dir/active_poller.cpp.o In file included from /usr/include/c++/8/vector:64, from /home/pi/code/cppzmq/build/catch/src/catch.hpp:677, from /home/pi/code/cppzmq/tests/message.cpp:2: /usr/include/c++/8/bits/stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Catch::SectionEndInfo; _Alloc = std::allocator]’: /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘gnu_cxx::normal_iterator<Catch::SectionEndInfo*, std::vector >’ changed in GCC 7.1 _M_realloc_insert(end(), x); ^~~~~ /usr/include/c++/8/bits/stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>::reverse_iterator std::vector<_Tp, _Alloc>::rbegin() [with _Tp = Catch::SectionEndInfo; _Alloc = std::allocator]’: /usr/include/c++/8/bits/stl_vector.h:735:38: note: parameter passing for argument of type ‘gnu_cxx::__normal_iterator<Catch::SectionEndInfo*, std::vector >’ changed in GCC 7.1 { return reverse_iterator(end()); } ^ /usr/include/c++/8/bits/stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>::reverse_iterator std::vector<_Tp, _Alloc>::rend() [with _Tp = Catch::SectionEndInfo; _Alloc = std::allocator]’: /usr/include/c++/8/bits/stl_vector.h:753:40: note: parameter passing for argument of type ‘gnu_cxx::normal_iterator<Catch::SectionEndInfo*, std::vector >’ changed in GCC 7.1 { return reverse_iterator(begin()); } ^ In file included from /usr/include/c++/8/vector:69, from /home/pi/code/cppzmq/build/catch/src/catch.hpp:677, from /home/pi/code/cppzmq/tests/message.cpp:2: /usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const Catch::SectionEndInfo&}; _Tp = Catch::SectionEndInfo; _Alloc = std::allocator]’: /usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector::iterator’ {aka ‘__gnu_cxx::normal_iterator<Catch::SectionEndInfo, std::vector >’} changed in GCC 7.1 vector<_Tp, _Alloc>:: ^~~~~~~ In file included from /usr/include/c++/8/bits/stl_algobase.h:67, from /usr/include/c++/8/bits/char_traits.h:39, from /usr/include/c++/8/ios:40, from /usr/include/c++/8/istream:38, from /usr/include/c++/8/sstream:38, from /home/pi/code/cppzmq/build/catch/src/catch.hpp:384, from /home/pi/code/cppzmq/tests/message.cpp:2: /usr/include/c++/8/bits/stl_iterator.h: In constructor ‘std::reverse_iterator<_Iterator>::reverse_iterator(std::reverse_iterator<_Iterator>::iterator_type) [with _Iterator = __gnu_cxx::__normal_iterator<Catch::SectionEndInfo, std::vector >]’: /usr/include/c++/8/bits/stl_iterator.h:133:7: note: parameter passing for argument of type ‘std::reverse_iterator<gnu_cxx::normal_iterator<Catch::SectionEndInfo*, std::vector > >::iterator_type’ {aka ‘gnu_cxx::normal_iterator<Catch::SectionEndInfo, std::vector >’} changed in GCC 7.1 reverse_iterator(iterator_type x) : current(x) { } ^~~~ [ 77%] Building CXX object tests/CMakeFiles/unit_tests.dir/multipart.cpp.o In file included from /usr/include/c++/8/vector:63, from /home/pi/code/cppzmq/build/catch/src/catch.hpp:677, from /home/pi/code/cppzmq/tests/message.cpp:2: /usr/include/c++/8/bits/stl_uninitialized.h: In function ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = Catch::SectionEndInfo; _ForwardIterator = Catch::SectionEndInfo; _Allocator = std::allocator]’: /usr/include/c++/8/bits/stl_uninitialized.h:311:2: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo>’ changed in GCC 7.1 return std::__uninitialized_copy_a

  (_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__first),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc);

/usr/include/c++/8/bits/stl_uninitialized.h: In function ‘_ForwardIterator std::uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator<Catch::SectionEndInfo>; _ForwardIterator = Catch::SectionEndInfo; _Tp = Catch::SectionEndInfo]’: /usr/include/c++/8/bits/stl_uninitialized.h:287:5: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1 uninitialized_copy_a(_InputIterator first, _InputIterator __last, ^~~~~~ /usr/include/c++/8/bits/stl_uninitialized.h:287:5: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo>’ changed in GCC 7.1 /usr/include/c++/8/bits/stl_uninitialized.h:289:37: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo>’ changed in GCC 7.1 { return std::uninitialized_copy(first, last, result); }

/usr/include/c++/8/bits/stl_uninitialized.h: In function ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<Catch::SectionEndInfo*>; _ForwardIterator = Catch::SectionEndInfo*]’:
/usr/include/c++/8/bits/stl_uninitialized.h:115:5: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1
     uninitialized_copy(_InputIterator __first, _InputIterator __last,
     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/stl_uninitialized.h:115:5: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1
/usr/include/c++/8/bits/stl_uninitialized.h:134:15: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1
       return std::__uninitialized_copy<__is_trivial(_ValueType1)
        && __is_trivial(_ValueType2)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        && __assignable>::
        ~~~~~~~~~~~~~~~~~~

__uninit_copy(first, last, __result);


/usr/include/c++/8/bits/stl_uninitialized.h: In static member function ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<Catch::SectionEndInfo*>; _ForwardIterator = Catch::SectionEndInfo*; bool _TrivialValueTypes = false]’:
/usr/include/c++/8/bits/stl_uninitialized.h:76:9: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1
         __uninit_copy(_InputIterator __first, _InputIterator __last,
         ^~~~~~~~~~~~~
/usr/include/c++/8/bits/stl_uninitialized.h:76:9: note: parameter passing for argument of type ‘std::move_iterator<Catch::SectionEndInfo*>’ changed in GCC 7.1
[ 81%] Building CXX object tests/CMakeFiles/unit_tests.dir/recv_multipart.cpp.o
[ 86%] Building CXX object tests/CMakeFiles/unit_tests.dir/send_multipart.cpp.o
[ 90%] Building CXX object tests/CMakeFiles/unit_tests.dir/monitor.cpp.o
[ 95%] Building CXX object tests/CMakeFiles/unit_tests.dir/utilities.cpp.o
[100%] Linking CXX executable ../bin/unit_tests
/usr/bin/ld: CMakeFiles/unit_tests.dir/message.cpp.o: in function `zmq::message_t::routing_id() const':
message.cpp:(.text._ZNK3zmq9message_t10routing_idEv[_ZNK3zmq9message_t10routing_idEv]+0x18): undefined reference to `zmq_msg_routing_id'
/usr/bin/ld: CMakeFiles/unit_tests.dir/message.cpp.o: in function `zmq::message_t::set_routing_id(unsigned int)':
message.cpp:(.text._ZN3zmq9message_t14set_routing_idEj[_ZN3zmq9message_t14set_routing_idEj]+0x20): undefined reference to `zmq_msg_set_routing_id'
/usr/bin/ld: CMakeFiles/unit_tests.dir/message.cpp.o: in function `zmq::message_t::group() const':
message.cpp:(.text._ZNK3zmq9message_t5groupEv[_ZNK3zmq9message_t5groupEv]+0x18): undefined reference to `zmq_msg_group'
/usr/bin/ld: CMakeFiles/unit_tests.dir/message.cpp.o: in function `zmq::message_t::set_group(char const*)':
message.cpp:(.text._ZN3zmq9message_t9set_groupEPKc[_ZN3zmq9message_t9set_groupEPKc]+0x20): undefined reference to `zmq_msg_set_group'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::poller_t()':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEEC2Ev[_ZN3zmq8poller_tINS_12no_user_dataEEC5Ev]+0x14): undefined reference to `zmq_poller_new'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<void>::poller_t()':
poller.cpp:(.text._ZN3zmq8poller_tIvEC2Ev[_ZN3zmq8poller_tIvEC5Ev]+0x14): undefined reference to `zmq_poller_new'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<int>::poller_t()':
poller.cpp:(.text._ZN3zmq8poller_tIiEC2Ev[_ZN3zmq8poller_tIiEC5Ev]+0x14): undefined reference to `zmq_poller_new'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::wait_all(std::vector<zmq::poller_event<zmq::no_user_data>, std::allocator<zmq::poller_event<zmq::no_user_data> > >&, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >)':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEE8wait_allERSt6vectorINS_12poller_eventIS1_EESaIS5_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE[_ZN3zmq8poller_tINS_12no_user_dataEE8wait_allERSt6vectorINS_12poller_eventIS1_EESaIS5_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE]+0x68): undefined reference to `zmq_poller_wait_all'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::remove(zmq::socket_ref)':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEE6removeENS_10socket_refE[_ZN3zmq8poller_tINS_12no_user_dataEE6removeENS_10socket_refE]+0x3c): undefined reference to `zmq_poller_remove'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<int>::remove(zmq::socket_ref)':
poller.cpp:(.text._ZN3zmq8poller_tIiE6removeENS_10socket_refE[_ZN3zmq8poller_tIiE6removeENS_10socket_refE]+0x3c): undefined reference to `zmq_poller_remove'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<int>::wait_all(std::vector<zmq::poller_event<int>, std::allocator<zmq::poller_event<int> > >&, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >)':
poller.cpp:(.text._ZN3zmq8poller_tIiE8wait_allERSt6vectorINS_12poller_eventIiEESaIS4_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE[_ZN3zmq8poller_tIiE8wait_allERSt6vectorINS_12poller_eventIiEESaIS4_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE]+0x68): undefined reference to `zmq_poller_wait_all'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::modify(zmq::socket_ref, zmq::event_flags)':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEE6modifyENS_10socket_refENS_11event_flagsE[_ZN3zmq8poller_tINS_12no_user_dataEE6modifyENS_10socket_refENS_11event_flagsE]+0x48): undefined reference to `zmq_poller_modify'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::socket_t>::poller_t()':
poller.cpp:(.text._ZN3zmq8poller_tINS_8socket_tEEC2Ev[_ZN3zmq8poller_tINS_8socket_tEEC5Ev]+0x14): undefined reference to `zmq_poller_new'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::socket_t>::wait_all(std::vector<zmq::poller_event<zmq::socket_t>, std::allocator<zmq::poller_event<zmq::socket_t> > >&, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >)':
poller.cpp:(.text._ZN3zmq8poller_tINS_8socket_tEE8wait_allERSt6vectorINS_12poller_eventIS1_EESaIS5_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE[_ZN3zmq8poller_tINS_8socket_tEE8wait_allERSt6vectorINS_12poller_eventIS1_EESaIS5_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE]+0x68): undefined reference to `zmq_poller_wait_all'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::socket_t>::modify(zmq::socket_ref, zmq::event_flags)':
poller.cpp:(.text._ZN3zmq8poller_tINS_8socket_tEE6modifyENS_10socket_refENS_11event_flagsE[_ZN3zmq8poller_tINS_8socket_tEE6modifyENS_10socket_refENS_11event_flagsE]+0x48): undefined reference to `zmq_poller_modify'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::destroy_poller_t::operator()(void*)':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEE16destroy_poller_tclEPv[_ZN3zmq8poller_tINS_12no_user_dataEE16destroy_poller_tclEPv]+0x1c): undefined reference to `zmq_poller_destroy'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::no_user_data>::add_impl(zmq::socket_ref, zmq::event_flags, zmq::no_user_data*)':
poller.cpp:(.text._ZN3zmq8poller_tINS_12no_user_dataEE8add_implENS_10socket_refENS_11event_flagsEPS1_[_ZN3zmq8poller_tINS_12no_user_dataEE8add_implENS_10socket_refENS_11event_flagsEPS1_]+0x4c): undefined reference to `zmq_poller_add'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<void>::destroy_poller_t::operator()(void*)':
poller.cpp:(.text._ZN3zmq8poller_tIvE16destroy_poller_tclEPv[_ZN3zmq8poller_tIvE16destroy_poller_tclEPv]+0x1c): undefined reference to `zmq_poller_destroy'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<void>::add_impl(zmq::socket_ref, zmq::event_flags, void*)':
poller.cpp:(.text._ZN3zmq8poller_tIvE8add_implENS_10socket_refENS_11event_flagsEPv[_ZN3zmq8poller_tIvE8add_implENS_10socket_refENS_11event_flagsEPv]+0x4c): undefined reference to `zmq_poller_add'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<int>::destroy_poller_t::operator()(void*)':
poller.cpp:(.text._ZN3zmq8poller_tIiE16destroy_poller_tclEPv[_ZN3zmq8poller_tIiE16destroy_poller_tclEPv]+0x1c): undefined reference to `zmq_poller_destroy'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<int>::add_impl(zmq::socket_ref, zmq::event_flags, int*)':
poller.cpp:(.text._ZN3zmq8poller_tIiE8add_implENS_10socket_refENS_11event_flagsEPi[_ZN3zmq8poller_tIiE8add_implENS_10socket_refENS_11event_flagsEPi]+0x4c): undefined reference to `zmq_poller_add'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::socket_t>::destroy_poller_t::operator()(void*)':
poller.cpp:(.text._ZN3zmq8poller_tINS_8socket_tEE16destroy_poller_tclEPv[_ZN3zmq8poller_tINS_8socket_tEE16destroy_poller_tclEPv]+0x1c): undefined reference to `zmq_poller_destroy'
/usr/bin/ld: CMakeFiles/unit_tests.dir/poller.cpp.o: in function `zmq::poller_t<zmq::socket_t>::add_impl(zmq::socket_ref, zmq::event_flags, zmq::socket_t*)':
poller.cpp:(.text._ZN3zmq8poller_tINS_8socket_tEE8add_implENS_10socket_refENS_11event_flagsEPS1_[_ZN3zmq8poller_tINS_8socket_tEE8add_implENS_10socket_refENS_11event_flagsEPS1_]+0x4c): undefined reference to `zmq_poller_add'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::poller_t()':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEEC2Ev[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEEC5Ev]+0x14): undefined reference to `zmq_poller_new'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::remove(zmq::socket_ref)':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE6removeENS_10socket_refE[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE6removeENS_10socket_refE]+0x3c): undefined reference to `zmq_poller_remove'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::modify(zmq::socket_ref, zmq::event_flags)':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE6modifyENS_10socket_refES2_[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE6modifyENS_10socket_refES2_]+0x48): undefined reference to `zmq_poller_modify'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::wait_all(std::vector<zmq::poller_event<std::function<void (zmq::event_flags)> >, std::allocator<zmq::poller_event<std::function<void (zmq::event_flags)> > > >&, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >)':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE8wait_allERSt6vectorINS_12poller_eventIS4_EESaIS8_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE8wait_allERSt6vectorINS_12poller_eventIS4_EESaIS8_EENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE]+0x68): undefined reference to `zmq_poller_wait_all'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::destroy_poller_t::operator()(void*)':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE16destroy_poller_tclEPv[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE16destroy_poller_tclEPv]+0x1c): undefined reference to `zmq_poller_destroy'
/usr/bin/ld: CMakeFiles/unit_tests.dir/active_poller.cpp.o: in function `zmq::poller_t<std::function<void (zmq::event_flags)> >::add_impl(zmq::socket_ref, zmq::event_flags, std::function<void (zmq::event_flags)>*)':
active_poller.cpp:(.text._ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE8add_implENS_10socket_refES2_PS4_[_ZN3zmq8poller_tISt8functionIFvNS_11event_flagsEEEE8add_implENS_10socket_refES2_PS4_]+0x4c): undefined reference to `zmq_poller_add'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/unit_tests.dir/build.make:250: bin/unit_tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:990: tests/CMakeFiles/unit_tests.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
sinaaghli commented 4 years ago

After some more searching, I found that "apt" version of libzmq (libzmq-dev & libzmq3-dev) cause this problem. I installed a local version (specifically tags/v4.6.0) and it compiled fine.

albestro commented 3 years ago

Just for future reference.

I addressed these linking problems when libzmq was built without draft APIs, while cppzmq was being built with them enabled. I don't think it is related to the platform/architecture, but IMO it may be that pre-built packages from distributions are built with default options and so without draft APIs.

In particular, the default value for the option ENABLE_DRAFTS in cppzmq is detected with this snippet of code https://github.com/zeromq/cppzmq/blob/18db4568f9ff1568193d3a496d87bed4bc9ec59e/CMakeLists.txt#L29-L33 so, if cppzmq source directory is a cloned git repository, draft APIs are enabled by default.

The solutions I see are either

It may be worth pointing out this option in the README.

Arandott commented 4 months ago

After some more searching, I found that "apt" version of libzmq (libzmq-dev & libzmq3-dev) cause this problem. I installed a local version (specifically tags/v4.6.0) and it compiled fine.

Hi.I'm new to cpp. Could you tell what command you use to install that local version?thanks

Arandott commented 4 months ago

Just for future reference.

I addressed these linking problems when libzmq was built without draft APIs, while cppzmq was being built with them enabled. I don't think it is related to the platform/architecture, but IMO it may be that pre-built packages from distributions are built with default options and so without draft APIs.

In particular, the default value for the option ENABLE_DRAFTS in cppzmq is detected with this snippet of code

https://github.com/zeromq/cppzmq/blob/18db4568f9ff1568193d3a496d87bed4bc9ec59e/CMakeLists.txt#L29-L33

so, if cppzmq source directory is a cloned git repository, draft APIs are enabled by default. The solutions I see are either

  • build libzmq with ENABLE_DRAFTS=on (in cmake, for autotools the equivalent is --enable-drafts)
  • build cppzmq with ENABLE_DRAFTS=off (if draft APIs are not needed)

It may be worth pointing out this option in the README.

thanks!!problem fixed