static library and undefined reference

Iker Arizmendi
Fri Apr 9 02:45:00 GMT 2004

Hello all.

I have a project that creates several static libraries
in two directories and an executable that uses them in
a third. The libraries build just fine, and the
executable builds fine, but fails during linking with
"undefined reference" errors. I've checked the libraries
with nm and can see that the symbols the linker claims
are undefined are exported (nm shows marks them with
a "T"). I've checked that the link line includes the
libraries and that libraries that are depended on by
other libraries appear first (and before the executable's
.o file). I also made sure that all the files involved
were compiled with g++ and not gcc. But the errors persist.

What am I missing here? Any help greatly appreciated.


Iker Arizmendi
AT&T Labs - Research
Speech and Image Processing Lab

More information about the Gcc-help mailing list