Boost Program Options won't work with GLIBCXX_DEBUG

你。 提交于 2019-12-05 02:29:22

The error message is very clear here, the linker cannot find the symbol

boost::program_options::detail::cmdline::cmdline(std::__debug::vector<std::string, std::allocator<std::string> > const&)

note the additional __debug namespace, which implies you are building with _GLIBCXX_DEBUG. This won't work since your package maintainer did not build the boost libraries with this defined, hence the linker error. You have a few options

  • remove _GLIBCXX_DEBUG from whatever translation units include the program options headers. This might require some refactoring depending on what you're trying to solve with iterator debugging enabled.
  • build the boost libraries with -D_GLIBCCX_DEBUG. This also may not be trivial, though the boost build system is fairly straightforward.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!