我正在尝试编译一些源代码。但是,它引发了一些与Boost库有关的错误。这是错误

undefined reference to `boost::re_detail::get_mem_block()'
main.cpp:(.text+0x40a6): undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
main.cpp:(.text+0x40db): undefined reference to `boost::re_detail::put_mem_block(void*)'
main.cpp:(.text+0x430a): undefined reference to `boost::re_detail::put_mem_block(void*)'
main.o: In function `_ZN7Command12createVectorIdEEvRKSsRSt6vectorIT_SaIS4_EES4_.constprop.1207':
main.cpp:(.text+0x436e): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
main.cpp:(.text+0x439f): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
main.cpp:(.text+0x43d0): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<

我在系统中安装了boost regex库,并使用-L选项指定了该库的路径,并使用-lboost_regex选项指定了该库。可能是什么问题?

它确实找到了图书馆。但是仍然抛出错误

最佳答案

我遇到了同样的问题,并且已经解决。因此,也许您之前已经安装了旧版本的boost,并且链接程序链接了旧版本。

尝试删除所有已安装的boost库,然后重新安装boost库,您的问题将得到解决。

关于c++ - Boost库的编译问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11001514/

10-11 23:02
查看更多