|
Boost Users : |
Subject: [Boost-users] Static linking program_options on ARM
From: Pau Garcia i Quiles (pgquiles_at_[hidden])
Date: 2015-09-05 19:58:20
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'
/tmp/ccORpK3T.o:(.bss._ZGVZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[_ZGVZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_trai
tsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty]+0x0): first defined here
/tmp/cch3i9Yf.ltrans0.ltrans.o:(.bss._ZZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[_ZZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St
11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty]+0x0):
multiple definition of `std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&
boost::program_options::validators::get_single_string<char>(std::vecto
r<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'
/tmp/ccORpK3T.o:(.bss._ZZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[_ZZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS
3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty]+0x0): first defined here
collect2: error: ld returned 1 exit status
Compiling Boost with or without C++11 does not affect either (it
happens on both cases).
Has anyone faced something like this?
Thank you
-- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net