Linker failing? OS X

Andrew Levenson andrew.levenson@gmail.com
Thu Jan 22 21:33:00 GMT 2009


I am trying to compile a simple program for a class of mine, but am  
receiving a strange error. The program compiles (using the gcc -c  
option), but it appears to be the Linker that is having some issues,  
as if it can't find the iostream lib. I adjusted my PATH to include / 
usr/lib and /usr/local/lib. What should I do to get gcc to work  
properly? The error is below.

Undefined symbols:
   "___gxx_personality_v0", referenced from:
       ___gxx_personality_v0$non_lazy_ptr in ccsMGEIy.o
   "std::basic_istream<char, std::char_traits<char>  
 >::operator>>(int&)", referenced from:
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
   "std::ios_base::Init::~Init()", referenced from:
       ___tcf_0 in ccsMGEIy.o
   "std::basic_ostream<char, std::char_traits<char> >& std::operator<<  
<std::char_traits<char> >(std::basic_ostream<char,  
std::char_traits<char> >&, char const*)", referenced from:
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
   "std::ios_base::Init::Init()", referenced from:
       __static_initialization_and_destruction_0(int, int)in ccsMGEIy.o
   "std::cin", referenced from:
       __ZSt3cin$non_lazy_ptr in ccsMGEIy.o
   "std::basic_ostream<char, std::char_traits<char>  
 >::operator<<(float)", referenced from:
       _main in ccsMGEIy.o
   "std::basic_ostream<char, std::char_traits<char>  
 >::operator<<(int)", referenced from:
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
       _main in ccsMGEIy.o
   "std::cout", referenced from:
       __ZSt4cout$non_lazy_ptr in ccsMGEIy.o
ld: symbol(s) not found
collect2: ld returned 1 exit status



More information about the Gcc-help mailing list