English 中文(简体)
无定义的参考促进:program_options:abstract_variables_map:operator[]
原标题:undefined reference boost::program_options::abstract_variables_map::operator[]

When I m linking program_options to my shared library with:

g++ -L/path_to_static_boost_libs -shared -o "test.so"  ./test.o   -lboost_program_options

我可以装上图书馆,因为关于抽象的“可变性”的未明确参考资料:

0009b9f8 W int const& boost::program_options::variable_value::as<int>() const
         U boost::program_options::abstract_variables_map::operator[](std::string const&) const
0009b55e W boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast> >::clone() const

I tried to build another program (not shared library) with program_options library linked statically and didn t get undefined reference.

在我把共用图书馆连接起来时,我为什么没有明确的提法?

最佳回答

步骤1:见mangled未解决的编号(可在dlerror( 错误信息上显示)。

第2步:发现提升图书馆为这一标志提供了定义:

nm -A /path_to_static_boost_libs/*.a | grep <mangled-symbol-name>

步骤3:在<代码>测试>上添加该图书馆。

第4步:利润。

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?