
On 06-Sep-15 2:58 AM, Pau Garcia i Quiles wrote:
Hello,
I am having trouble when linking Boost::Program_Options statically on Linux ARM 32-bit: it spits an error about a duplicate symbol for a guard-variable.
It works fine on Linux ARM 32-bit (same compiler) if using shared libraries, and also on Linux x86-64 both with static and shared libraries.
I can reproduce the problem with the examples included in the libs/program_options/examples: real.cpp and custom_syntax.cpp compile and run fine but first.cpp, multiple_sources.cpp options_description.cpp, option_groups.cpp and regex.cpp fail:
$ armv7a-openelec-linux-gnueabi-g++ -std=c++11 -o option_groups option_groups.cpp -L $SYSROOT/usr/lib -lboost_program_options
/tmp/cch3i9Yf.ltrans0.ltrans.o:(.bss._ZGVZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[_ZGVZN5boost15program_options10validators17get_single_stringIcEERKSbI T_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty]+0x0): multiple definition of `guard variable for std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& boost::program_options::validators::get_single_ string<char>(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool)::empty'
Has anyone faced something like this?
Hi Pau, I did not see such an error before, and I suspect it might be a bug in your toolchain. What version armv7-openelec-linux-gnueabi-g++ is, and who built that version? Maybe they might be more helpful with this error. - Volodya
Thank you