public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Spurious undefined reference error?
@ 2012-12-20 19:22 Dan Kegel
  2012-12-20 19:48 ` Dan Kegel
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Kegel @ 2012-12-20 19:22 UTC (permalink / raw)
  To: binutils

The command (sanitized)

g++ -Wl,--verbose -v -pthread videos.C -Wl,-rpath,/opt/foo/bar/lib
-L/opt/foo/bar/lib \
-lxxx3 -lxxx6++ -llxxx7++ -lxxx6 -lxxx7 ../xxx8/xxx8.a -o videos

fails for me with

found libxxx6++.so at /opt/foo/bar/lib/libxxx6++.so
/usr/local/bin/ld: /opt/foo/bar/lib/libxxx3.so: undefined reference to
symbol 'foo::xxx6::bletch() const'
/usr/local/bin/ld: note: 'foo::xxx6::bletch() const' is defined in DSO
/opt/foo/bar/lib/libxxx6++.so so try adding it to the linker command
line

The commandline

g++ -Wl,--verbose -v -pthread videos.C -Wl,-rpath,/opt/foo/bar/lib
-L/opt/foo/bar/lib \
-lxxx3 -lxxx6++ -llxxx7++ -lxxx6 -lxxx7 ../xxx8/xxx8.a
/opt/foo/bar/lib/libxxx6++.so -o videos

works.

Why, if it was able to find the library, can't it use it without an
absolute path?

ld --version says 2.22; this is the stock linker on ubuntu 12.04 x86-64.

(Building a fresh binutils-2.23 from source in /usr/local doesn't seem
to help.... probably because even /usr/local/bin/ld --version still
says 2.22 then, so evidently it's not that easy to replace binutils.
A clue on how to gather more info would be appreciated.)

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

end of thread, other threads:[~2013-01-08  6:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 19:22 Spurious undefined reference error? Dan Kegel
2012-12-20 19:48 ` Dan Kegel
2012-12-20 20:00   ` H.J. Lu
2012-12-20 23:19     ` Dan Kegel
2013-01-08  6:10       ` Alan Modra

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