const&)'
const&)'
const&)'
const&)'
const&)'
const&)'
const&)'
const&)'
const&)'
const&) const'
Hello, everyone,
I'd like to please ask if someone could help me with a problem that
I'm having linking against boost_program_options on linux with gcc
3.4.4 on a dual-core opteron machine. I produce my object files with g
++ -c fine from my source, but at link time ld does not seem to be
able to locate the right symbols, despite finding /usr/lib/
libboost_program_options.so. This compile seems to work fine under
Mac OS X with xcode, and I've spent quite a lot of time trying to
compile my own boost which tests fine but has the same problems with
my linking... If someone could help me understand what I'm doing
wrong, I would be very appreciative! Thank you!
: Sarah Conner
: The Pennsylvania State University, Dept. of Computer Science and
Engineering
Command line output follows:
[sconner@inti 01:17 PM] ~/TorusSim-Repository/objects$ g++ -o ../
a.out -lboost_program_options -ldl *.o
main.o(.text+0x0): In function `main':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/
bits/ios_base.h:84: multiple definition of `main'
main backup.o(.text+0x0):/usr/include/boost/program_options/
errors.hpp:31: first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 9669 in main
backup.o to 29829 in main.o
main backup.o(.text+0x86): In function `main':
: undefined reference to
`boost::program_options::options_description::options_description
(std::basic_string,
std::allocator > > const&, bool) const'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueImcEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options20invalid_option_valueE
+0x10): undefined reference to `typeinfo for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.r._ZTVN5boost15program_options20invalid_option_valueE
+0x20): undefined reference to
`boost::program_options::validation_error::what() const'
main backup.o
(.gnu.linkonce.r._ZTVN5boost15program_options11typed_valueIycEE
+0x38): undefined reference to
`boost::program_options::value_semantic_codecvt_helper<char>::parse
(boost::any&, std::vector,
std::allocator > > const&, bool) const'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueIycEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main backup.o
(.gnu.linkonce.r._ZTVN5boost15program_options11typed_valueISscEE
+0x38): undefined reference to
`boost::program_options::value_semantic_codecvt_helper<char>::parse
(boost::any&, std::vector,
std::allocator > > const&, bool) const'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueISscEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main backup.o
(.gnu.linkonce.r._ZTVN5boost15program_options11typed_valueIicEE
+0x38): undefined reference to
`boost::program_options::value_semantic_codecvt_helper<char>::parse
(boost::any&, std::vector,
std::allocator > > const&, bool) const'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueIicEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main backup.o
(.gnu.linkonce.r._ZTVN5boost15program_options11typed_valueIjcEE
+0x38): undefined reference to
`boost::program_options::value_semantic_codecvt_helper<char>::parse
(boost::any&, std::vector,
std::allocator > > const&, bool) const'
main backup.o
(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueIjcEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options16validation_errorD1Ev
+0x32): In function
`boost::program_options::validation_error::~validation_error()':
: undefined reference to `vtable for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options25basic_command_line_parserI
cE3runEv+0x5): In function
`boost::program_options::basic_command_line_parser<char>::run() const':
: undefined reference to
`boost::program_options::common_command_line_parser::run() const'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options11to_internalISsEESt6vectorIS
sSaISsEERKS2_IT_SaIS5_EE+0x56): In function
`std::vector, std::allocator > >
boost::program_options::to_internal >
(std::vector, std::allocator > > const&)':
: undefined reference to `boost::program_options::to_internal
(std::basic_string, std::allocator > > const&)'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIjcE4nameEv
+0x36): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIjcE4nameEv
+0x69): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIicE4nameEv
+0x36): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIicE4nameEv
+0x69): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIycE4nameEv
+0x36): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIycE4nameEv
+0x69): more undefined references to `boost::program_options::arg'
follow
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueISscE6xparseERN
S_3anyERKSt6vectorISsSaISsEE+0xb): In function
`boost::program_options::typed_value, char>::xparse
(boost::any&, std::vector,
std::allocator > > const&) const':
: undefined reference to `boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, std::basic_string*, int)'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueImcE4nameEv
+0x36): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueImcE4nameEv
+0x69): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options20invalid_option_valueD1Ev
+0x32): In function
`boost::program_options::invalid_option_value::~invalid_option_value()':
: undefined reference to `vtable for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options20invalid_option_valueD0Ev
+0x32): In function
`boost::program_options::invalid_option_value::~invalid_option_value()':
: undefined reference to `vtable for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options10validators17get_single_stri
ngIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEb
+0xc1): In function `std::basic_string const&
boost::program_options::validators::get_single_string<char>
(std::vector, std::allocator > > const&, bool)':
: undefined reference to `vtable for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options10validators17get_single_stri
ngIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEb
+0xdc): In function `std::basic_string const&
boost::program_options::validators::get_single_string<char>
(std::vector, std::allocator > > const&, bool)':
: undefined reference to `typeinfo for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options10validators17get_single_stri
ngIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEb
+0x17a): In function `std::basic_string const&
boost::program_options::validators::get_single_string<char>
(std::vector, std::allocator > > const&, bool)':
: undefined reference to `vtable for
boost::program_options::validation_error'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIjcEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x31): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, unsigned int*, long)':
: undefined reference to
`boost::program_options::validators::check_first_occurrence
(boost::any const&)'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIjcEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x170): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, unsigned int*, long)':
: undefined reference to
`boost::program_options::invalid_option_value::invalid_option_value
(std::basic_string
(boost::any&, std::vector,
std::allocator > > const&, int*, long)':
: undefined reference to
`boost::program_options::validators::check_first_occurrence
(boost::any const&)'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x170): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, int*, long)':
: undefined reference to
`boost::program_options::invalid_option_value::invalid_option_value
(std::basic_string(boost::any&, std::vector,
std::allocator > > const&, unsigned long long*, long)':
: undefined reference to
`boost::program_options::validators::check_first_occurrence
(boost::any const&)'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIycEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x172): In
function `void boost::program_options::validate(boost::any&, std::vector,
std::allocator > > const&, unsigned long long*, long)':
: undefined reference to
`boost::program_options::invalid_option_value::invalid_option_value
(std::basic_string
(boost::any&, std::vector,
std::allocator > > const&, unsigned long*, long)':
: undefined reference to
`boost::program_options::validators::check_first_occurrence
(boost::any const&)'
main backup.o
(.gnu.linkonce.t._ZN5boost15program_options8validateImcEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x172): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, unsigned long*, long)':
: undefined reference to
`boost::program_options::invalid_option_value::invalid_option_value
(std::basic_string&,
boost::program_options::options_description const&)'
main.o(.text+0x2880): In function `main':
: undefined reference to `boost::program_options::operator<<
(std::basic_ostream&,
boost::program_options::options_description const&)'
main.o(.text+0x28b1): In function `main':
: undefined reference to `boost::program_options::operator<<
(std::basic_ostream&,
boost::program_options::options_description const&)'
main.o(.text+0x28cd): In function `main':
: undefined reference to `vtable for
boost::program_options::variables_map'
main.o(.text+0x4398): In function `main':
: undefined reference to `vtable for
boost::program_options::variables_map'
main.o(.text+0x6220): In function `main':
: undefined reference to
`boost::program_options::abstract_variables_map::operator[]
(std::basic_string&,
boost::program_options::options_description const&)'
main.o(.text+0x6389): In function `main':
: undefined reference to `boost::program_options::store
(boost::program_options::basic_parsed_options<char> const&,
boost::program_options::variables_map&, bool)'
main.o(.gnu.linkonce.r._ZTVN5boost15program_options11typed_valueIdcEE
+0x38): undefined reference to
`boost::program_options::value_semantic_codecvt_helper<char>::parse
(boost::any&, std::vector,
std::allocator > > const&, bool) const'
main.o(.gnu.linkonce.r._ZTIN5boost15program_options11typed_valueIdcEE
+0x10): undefined reference to `typeinfo for
boost::program_options::value_semantic_codecvt_helper<char>'
main.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIdcE4nameEv
+0x36): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main.o
(.gnu.linkonce.t._ZNK5boost15program_options11typed_valueIdcE4nameEv
+0x69): In function `boost::program_options::typed_value::name() const':
: undefined reference to `boost::program_options::arg'
main.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIdcEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x31): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, double*, long)':
: undefined reference to
`boost::program_options::validators::check_first_occurrence
(boost::any const&)'
main.o
(.gnu.linkonce.t._ZN5boost15program_options8validateIdcEEvRNS_3anyERKSt6
vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l+0x186): In
function `void boost::program_options::validate
(boost::any&, std::vector,
std::allocator > > const&, double*, long)':
: undefined reference to
`boost::program_options::invalid_option_value::invalid_option_value
(std::basic_string
const&)'
collect2: ld returned 1 exit status
[sconner@inti 01:18 PM] ~/TorusSim-Repository/objects$ ls /usr/lib/
*boost*
/usr/lib/libboost_date_time.so.1 /usr/lib/
libboost_prg_exec_monitor.so.1 /usr/lib/libboost_python.so.
1 /usr/lib/libboost_signals.so.1 /usr/lib/
libboost_thread.so.1
/usr/lib/libboost_date_time.so.1.32.0 /usr/lib/
libboost_prg_exec_monitor.so.1.32.0 /usr/lib/libboost_python.so.
1.32.0 /usr/lib/libboost_signals.so.1.32.0 /usr/lib/
libboost_thread.so.1.32.0
/usr/lib/libboost_filesystem.so.1 /usr/lib/
libboost_program_options.so.1 /usr/lib/libboost_regex.so.
1 /usr/lib/libboost_test_exec_monitor.so.1 /usr/lib/
libboost_unit_test_framework.so.1
/usr/lib/libboost_filesystem.so.1.32.0 /usr/lib/
libboost_program_options.so.1.32.0 /usr/lib/libboost_regex.so.
1.32.0 /usr/lib/libboost_test_exec_monitor.so.1.32.0 /usr/lib/
libboost_unit_test_framework.so.1.32.0