Re: runtime link path and g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wes,

> How can I specify this path to g++? I've seen -R used in some places, but g++
doesn't understand it.

This is a linker issue, not so much a GCC issue.  (Although it would be nice
for the GCC tool chain driver to be a little more rpath savvy across
platforms.)

Try -Wl,-rpath=/path/you/want or consider LD_LIBRARY_PATH=/path/you/want as
an environmental to your executable.

http://en.wikipedia.org/wiki/Rpath_(linking)

I'm not familiar with Ubuntu Linux, so it may do things slightly
differently.

For instance, I've heard that Ubuntu uses a different /bin/sh shell (dash
rather than bash), which results in x100 performance for their shell, and
lots of shell impedance mismatch from those who write bash-isms into what
probably should be /bin/sh clean.  The caveat is:  YMMV.

The rpath option has a few sharp edges.  When used with relative paths, it's
a security hole for the wily and devious.  If using absolute paths, it makes
the application much less mv-able.

The LD_LIBRARY_PATH option may necessitate having a user-convenience
launching script.  That allows your installer to construct the launching
script with all the right baked paths for LD_LIBRARY_PATH, or for the really
tricky, the launching script may figure out those setting dynamically from
how it was launched (using $0).

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux