public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Linker failing? OS X
@ 2009-01-22 21:33 Andrew Levenson
  2009-01-22 21:47 ` Blazej
  2009-01-23 12:14 ` John (Eljay) Love-Jensen
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Levenson @ 2009-01-22 21:33 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Linker failing? OS X
  2009-01-22 21:33 Linker failing? OS X Andrew Levenson
@ 2009-01-22 21:47 ` Blazej
  2009-01-23 12:14 ` John (Eljay) Love-Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: Blazej @ 2009-01-22 21:47 UTC (permalink / raw)
  To: gcc-help

>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.

Probably some of the linker switches are set incorrectly. Please ensure that
you have all needed library in -l list (especially std library). Please also
pay attention to enter -l switch at the end of command line.

For instance: 
$>gcc -I/usr/lib -I/usr/local/lib -L/lib \
>myfile.c -c myfile.out -lstdc++ -lmingw32

It should help unless there are errors in your program itself. 

Regards,
Blaazej






----------------------------------------------------------------------
Sprawdz, co wyswietlaja kina w Twoim miescie!
http://link.interia.pl/f2028

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linker failing? OS X
  2009-01-22 21:33 Linker failing? OS X Andrew Levenson
  2009-01-22 21:47 ` Blazej
@ 2009-01-23 12:14 ` John (Eljay) Love-Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: John (Eljay) Love-Jensen @ 2009-01-23 12:14 UTC (permalink / raw)
  To: Andrew Levenson, GCC-help

Hi Andrew,

> What should I do to get gcc to work properly?

GCC's gcc is the C compiler/linker toolchain driver.

GCC's g++ is the C++ compiler/linker toolchain driver.

Try using g++ for your C++ instead of gcc (which is for C).

HTH,
-Eljay

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-23 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-22 21:33 Linker failing? OS X Andrew Levenson
2009-01-22 21:47 ` Blazej
2009-01-23 12:14 ` John (Eljay) Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).