Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just installed debian and got following problem: When trying to compile a simple program that uses some aspects of the std-lib (like vectors, strings and so on), I get following error messages on linking:
Code:
g++ -lm -O3 -ffast-math -Wall -I. main.o utils.o vector.o color.o matrix.o transform.o shape.o sphere.o -o iray
utils.o: In function `__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize()':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx18__common_pool_baseINS_6__poolELb1EE13_S_initializeEv[__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize()]+0xd2): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
utils.o: In function `__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize_once()':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx18__common_pool_baseINS_6__poolELb1EE18_S_initialize_onceEv[__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize_once()]+0x101): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
utils.o: In function `__gnu_cxx::__mt_alloc<NumValue, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> >::allocate(unsigned int, void const*)':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx10__mt_allocI8NumValueNS_20__common_pool_policyINS_6__poolELb1EEEE8allocateEjPKv[__gnu_cxx::__mt_alloc<NumValue, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> >::allocate(unsigned int, void const*)]+0x2a1): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
color.o: In function `Color::getString()':
color.cpp:(.text+0x16d): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
color.cpp:(.text+0x175): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
color.o: In function `char* std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag)':
color.cpp:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x26): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned int, std::allocator<char> const&)'
color.cpp:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x73): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
color.cpp:(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x79): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
color.o: In function `std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::seekoff(long, std::_Ios_Seekdir, std::_Ios_Openmode)':
color.cpp:(.gnu.linkonce.t._ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekoffElSt12_Ios_SeekdirSt13_Ios_Openmode+0x1a9): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::_M_out_cur_move(long)'
color.o: In function `std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::seekpos(std::fpos<__mbstate_t>, std::_Ios_Openmode)':
color.cpp:(.gnu.linkonce.t._ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode+0x128): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::_M_out_cur_move(long)'
color.o: In function `std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow(int)':
color.cpp:(.gnu.linkonce.t._ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8overflowEi+0xd5): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::_M_out_cur_move(long)'
collect2: ld returned 1 exit status
make: *** [all] Error 1
well, thanks for your suggestion :) I tried it, but I am still not able to compile my raytracer on debian sid. I'm getting a new kind of output now, though:
Code:
g++ -L/usr/lib -lm -lstdc++ -O3 -ffast-math -Wall -I. main.o utils.o vector.o color.o matrix.o transform.o shape.o sphere.o -o ivanray
utils.o: In function `__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize()':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx18__common_pool_baseINS_6__poolELb1EE13_S_initializeEv[__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize()]+0xd2): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
utils.o: In function `__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize_once()':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx18__common_pool_baseINS_6__poolELb1EE18_S_initialize_onceEv[__gnu_cxx::__common_pool_base<__gnu_cxx::__pool, true>::_S_initialize_once()]+0x101): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
utils.o: In function `__gnu_cxx::__mt_alloc<NumValue, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> >::allocate(unsigned int, void const*)':
utils.cpp:(.gnu.linkonce.t._ZN9__gnu_cxx10__mt_allocI8NumValueNS_20__common_pool_policyINS_6__poolELb1EEEE8allocateEjPKv[__gnu_cxx::__mt_alloc<NumValue, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> >::allocate(unsigned int, void const*)]+0x2a1): undefined reference to `__gnu_cxx::__pool<true>::_M_initialize()'
collect2: ld returned 1 exit status
make: *** [all] Error 1
EDIT:
But now I noticed something strange: sometimes apt-get complains about a missing version of GLIBCXX when installing some deb-files:
Code:
update-menus: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.6' not found (required by update-menus)
I haven't seen that one before... so where is this reference pointing to? what kind of library should I install or re-install? libc? I thought that everything was updated all right... Shouldn't have switched to Debian :( My Slackware was fine enough. What do they say? Don't fix what ain't broken?
Last edited by MasterOfTheWind; 10-16-2005 at 12:38 PM.
Oh yes, of course you are right! Compilation works with g++-3.3! Thanks a lot!
Though I still can't understand one thing: I have installed libstdc++ 5 and 6 while I also have g++ of versions 2.95, 3.3, 3.4 and 4.0. Don't ask how they ended up on my system, 'cause I can't recall installing them (does debian install them by default or something?? but c'mon... 4 versions??). Well, anyway, it's all right that g++ 2.95 and 2.33 choose libstdc++ 5 instead of libstdc++ 6, but why do g++ 3.4 and 4.0 automatically use that same version (libstdc++ 5)? Is there any way to make them aware that the libstdc++ 6 is also installed?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.