简体   繁体   中英

Compilation issue with boost library

I am trying to compile some source codes. However it is throwing some error related to boost library. Here is the error

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<

I have the boost regex library installed in my system and I have given the path to the library using -L option and specified the library using -lboost_regex option as well. What could be the issue?

It does find the library. But still throwing an error

I met the same problem, and it has been solved. So maybe you had installed an older version of boost before, and the linker linkes the older version.

Try to remove all installed boost library, and reinstall the boost library, your problem will be solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM