Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Undefined references
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mikix
Guest





PostPosted: Sun Apr 28, 2002 12:14 am    Post subject: Undefined references Reply with quote

Hello. I am compiling a program, using the STD list data structure, and I get the following linking errors:

Code:

map.o: In function `__malloc_alloc_template<0>::_S_oom_malloc(unsigned int)':
map.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)+0x1a): undefined reference to `endl(ostream &)'
map.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)+0x27): undefined reference to `cerr'
map.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)+0x2c): undefined reference to `ostream::operator<<(char const *)'
map.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)+0x37): undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status


Now, from browsing around online, I found that this means my STL libraries are messed up somehow, and this has something to do with the libstdc++ package. Gentoo doesn't seem to have this package. I installed the STLport package and specified -I/usr/include/stlport, which just produced more of the same errors. How would I go about fixing this problem?

Thanks in advance,
Michael Terry
Back to top
mikix
Guest





PostPosted: Sun Apr 28, 2002 12:57 am    Post subject: Fixed it Reply with quote

Ok. After talking to a friend, I added the linking flag -lstdc++, it worked without "using namespace std;" or any other changes.
Back to top
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Sun Apr 28, 2002 1:02 am    Post subject: Reply with quote

Thanks for following up, nice to hear people's answers instead of just their problems. :)
_________________
- Kyle Manna

Please, please SEARCH before posting.

There are three kinds of people in the world: those who can count, and those who can't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum