I'm having troubles with log4cpp... when I compile my program, errors appear while linking. Here are the errors I got and the command I use to compile it :
g++ -O2 -g -o tun tun.cpp -lZThread -llog4cpp
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_List_node_base::hook(std::_List_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> >::_Rep::_S_empty_rep_storage'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*
, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::
_Rb_tree_node_base&)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_ostream<char, std::char_traits<char> >::seekp(long lon
g, std::_Ios_Seekdir)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> >::_Rep::_S_create(unsigned, unsigned, std::allocator<char> const&)'
collect2: ld returned 1 exit status
To developp this program, I use log4cpp 0.3.4b, Mandriva 10.1 and g++ 3.3.4. Do you know how I could resolve this problem ?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm having troubles with log4cpp... when I compile my program, errors appear while linking. Here are the errors I got and the command I use to compile it :
g++ -O2 -g -o tun tun.cpp -lZThread -llog4cpp
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_List_node_base::hook(std::_List_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> >::_Rep::_S_empty_rep_storage'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*
, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::
_Rb_tree_node_base&)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_ostream<char, std::char_traits<char> >::seekp(long lon
g, std::_Ios_Seekdir)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4/../../../liblog4cpp.so: undefined
reference to `std::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> >::_Rep::_S_create(unsigned, unsigned, std::allocator<char> const&)'
collect2: ld returned 1 exit status
To developp this program, I use log4cpp 0.3.4b, Mandriva 10.1 and g++ 3.3.4. Do you know how I could resolve this problem ?
Thanks