How to use "nm" for "undefined reference" problem catch.

Ian Lance Taylor iant@google.com
Fri Dec 15 00:08:00 GMT 2006


Gengis Kanhg Toledo "RamXrez" <gengiskanhg.geo@yahoo.com> writes:

> The problem:
> 
> $ g   ./main.cc -o prueba
> /home/<myname>/tmp/ccEOfejM.o(.text 0x11): In function
> `main':
> : undefined reference to `foo()'
> collect2: ld returned 1 exit status

You didn't link against foo.o.  gcc will only include foo.o if you
tell it too.

Ian



More information about the Gcc-help mailing list