每当我使用boost :: signal编译程序时,我都会遇到以下错误:
/tmp/ccQFaJsy.o: In function `main':
b_vect.cpp:(.text+0xb7): undefined reference to `boost::signals::connection::~connection()'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::slot_base::data_t::~data_t()':
b_vect.cpp:(.text._ZN5boost7signals6detail9slot_base6data_tD1Ev[boost::signals::detail::slot_base::data_t::~data_t()]+0x16): undefined reference to `boost::signals::connection::~connection()'
/tmp/ccQFaJsy.o: In function `boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::signal0(boost::last_value<void> const&, std::less<int> const&)':
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEC1ERKS2_RKS4_[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::signal0(boost::last_value<void> const&, std::less<int> const&)]+0x51): undefined reference to `boost::signals::detail::signal_base::signal_base(boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group, std::allocator<boost::function_base> > const&, boost::any const&)'
/tmp/ccQFaJsy.o: In function `boost::slot<boost::function0<void, std::allocator<boost::function_base> > >::slot<HelloWorld>(HelloWorld const&)':
b_vect.cpp:(.text._ZN5boost4slotINS_9function0IvSaINS_13function_baseEEEEEC1I10HelloWorldEERKT_[boost::slot<boost::function0<void, std::allocator<boost::function_base> > >::slot<HelloWorld>(HelloWorld const&)]+0xac): undefined reference to `boost::signals::detail::slot_base::create_connection()'
/tmp/ccQFaJsy.o: In function `boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::connect(boost::slot<boost::function0<void, std::allocator<boost::function_base> > > const&, boost::signals::connect_position)':
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEE7connectERKNS_4slotIS8_EENS_7signals16connect_positionE[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::connect(boost::slot<boost::function0<void, std::allocator<boost::function_base> > > const&, boost::signals::connect_position)]+0x9a): undefined reference to `boost::signals::detail::signal_base_impl::connect_slot(boost::any const&, boost::signals::detail::stored_group const&, boost::shared_ptr<boost::signals::detail::slot_base::data_t>, boost::signals::connect_position)'
/tmp/ccQFaJsy.o: In function `void boost::iterator_core_access::increment<boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator&)':
b_vect.cpp:(.text._ZN5boost20iterator_core_access9incrementINS_7signals6detail23named_slot_map_iteratorEEEvRT_[void boost::iterator_core_access::increment<boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator&)]+0x11): undefined reference to `boost::signals::detail::named_slot_map_iterator::increment()'
/tmp/ccQFaJsy.o: In function `bool boost::iterator_core_access::equal<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator const&, boost::signals::detail::named_slot_map_iterator const&, mpl_::bool_<true>)':
b_vect.cpp:(.text._ZN5boost20iterator_core_access5equalINS_7signals6detail23named_slot_map_iteratorES4_EEbRKT_RKT0_N4mpl_5bool_ILb1EEE[bool boost::iterator_core_access::equal<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator const&, boost::signals::detail::named_slot_map_iterator const&, mpl_::bool_<true>)]+0x19): undefined reference to `boost::signals::detail::named_slot_map_iterator::equal(boost::signals::detail::named_slot_map_iterator const&) const'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::named_slot_map_iterator::reference boost::iterator_core_access::dereference<boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator const&)':
b_vect.cpp:(.text._ZN5boost20iterator_core_access11dereferenceINS_7signals6detail23named_slot_map_iteratorEEENT_9referenceERKS5_[boost::signals::detail::named_slot_map_iterator::reference boost::iterator_core_access::dereference<boost::signals::detail::named_slot_map_iterator>(boost::signals::detail::named_slot_map_iterator const&)]+0x11): undefined reference to `boost::signals::detail::named_slot_map_iterator::dereference() const'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::named_slot_map_iterator std::__find_if<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable>(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable, std::input_iterator_tag)':
b_vect.cpp:(.text._ZSt9__find_ifIN5boost7signals6detail23named_slot_map_iteratorENS2_11is_callableEET_S5_S5_T0_St18input_iterator_tag[boost::signals::detail::named_slot_map_iterator std::__find_if<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable>(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable, std::input_iterator_tag)]+0x6d): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::named_slot_map_iterator std::find_if<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable>(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable)':
b_vect.cpp:(.text._ZSt7find_ifIN5boost7signals6detail23named_slot_map_iteratorENS2_11is_callableEET_S5_S5_T0_[boost::signals::detail::named_slot_map_iterator std::find_if<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable>(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable)]+0x2b): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZSt7find_ifIN5boost7signals6detail23named_slot_map_iteratorENS2_11is_callableEET_S5_S5_T0_[boost::signals::detail::named_slot_map_iterator std::find_if<boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable>(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::is_callable)]+0x38): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)':
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEEC1ESB_SB_SA_RNS_8optionalINS1_8unusableEEE[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)]+0x34): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEEC1ESB_SB_SA_RNS_8optionalINS1_8unusableEEE[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)]+0x45): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o:b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEEC1ESB_SB_SA_RNS_8optionalINS1_8unusableEEE[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)]+0x71): more undefined references to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)' follow
/tmp/ccQFaJsy.o: In function `boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)':
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEEC1ESB_SB_SA_RNS_8optionalINS1_8unusableEEE[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::slot_call_iterator(boost::signals::detail::named_slot_map_iterator, boost::signals::detail::named_slot_map_iterator, boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::optional<boost::signals::detail::unusable>&)]+0xa6): undefined reference to `boost::signals::detail::named_slot_map_iterator::operator=(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::increment()':
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE9incrementEv[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::increment()]+0x19): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE9incrementEv[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::increment()]+0x31): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZN5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE9incrementEv[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::increment()]+0x56): undefined reference to `boost::signals::detail::named_slot_map_iterator::operator=(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o: In function `boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const':
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0x2c): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0x3c): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0x70): undefined reference to `boost::signals::detail::named_slot_map_iterator::operator=(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0x84): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0x94): undefined reference to `boost::signals::detail::named_slot_map_iterator::named_slot_map_iterator(boost::signals::detail::named_slot_map_iterator const&)'
b_vect.cpp:(.text._ZNK5boost7signals6detail18slot_call_iteratorINS1_11call_bound0IvE6callerINS_9function0IvSaINS_13function_baseEEEEEENS1_23named_slot_map_iteratorEE5equalERKSC_[boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator>::equal(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function0<void, std::allocator<boost::function_base> > >, boost::signals::detail::named_slot_map_iterator> const&) const]+0xbf): undefined reference to `boost::signals::detail::named_slot_map_iterator::operator=(boost::signals::detail::named_slot_map_iterator const&)'
/tmp/ccQFaJsy.o: In function `boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()':
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0x22): undefined reference to `boost::signals::detail::call_notification::call_notification(boost::shared_ptr<boost::signals::detail::signal_base_impl> const&)'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0x69): undefined reference to `boost::signals::detail::named_slot_map::end()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0x85): undefined reference to `boost::signals::detail::named_slot_map::end()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0xc9): undefined reference to `boost::signals::detail::named_slot_map::end()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0xe2): undefined reference to `boost::signals::detail::named_slot_map::begin()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0x141): undefined reference to `boost::signals::detail::call_notification::~call_notification()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEEclEv[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::operator()()]+0x184): undefined reference to `boost::signals::detail::call_notification::~call_notification()'
/tmp/ccQFaJsy.o: In function `boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::~signal0()':
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEED1Ev[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::~signal0()]+0x1a): undefined reference to `boost::signals::trackable::~trackable()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEED1Ev[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::~signal0()]+0x2b): undefined reference to `boost::signals::detail::signal_base::~signal_base()'
b_vect.cpp:(.text._ZN5boost7signal0IvNS_10last_valueIvEEiSt4lessIiENS_9function0IvSaINS_13function_baseEEEEED1Ev[boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function0<void, std::allocator<boost::function_base> > >::~signal0()]+0x46): undefined reference to `boost::signals::detail::signal_base::~signal_base()'
collect2: ld returned 1 exit status
请有人帮助我。
答案 0 :(得分:4)
这些是来自链接器的错误。因此,代码编译良好,并且生成了所有objetc,但链接器告诉您已使用未出现在任何对象或文件中的符号(例如,函数,类方法)。因此,您必须将带有这些符号的对象或库添加到要链接的文件列表中。你想要的符号可能在boost二进制文件中。
答案 1 :(得分:1)
对于你的回答,这可能有点晚了。在评论中看到您的代码后,我认为您没有调用正确的库。
#include <boost/signals2.hpp>
#include <iostream>
void func1()
{
std::cout << "Hello world" << std::flush;
}
int main()
{
boost::signals2::signal<void ()> s;
s.connect(func1);
s();
}
你必须包括signals2.hpp而不是信号(虽然我不太确定)。这对我来说很好。