Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unrecognized option `-rpath'

4,765 views
Skip to first unread message

Georg Maaß

unread,
Jul 19, 2001, 5:34:18 PM7/19/01
to
When I try to tell g++ where the compiled application should search at
runtime for shared libraries, using the -rpath /users/myproject/lib/
option I get this error message.

g++: unrecognized option `-rpath'

At runtime the application crashes at the first call of a function of
the library. I guess that the library is not loaded at runtime which
causes the crash.

Are there any special restrictions on the usage of this option, or is
this a bug in g++, or did I misunderstand something about this option?

I used g++ 2.95.3, which was built to generated static output by de-
fault. The application links everything static except this single
shared library.

Greetings, Georg
--
Georg Maaß - bioshop.de D-20535 Hamburg, Sievekingsallee 35
JavaScript, C++ Engineering

- The ultimative DHTML engine: http://gml-modul.sourceforge.net -

Martin Vicente

unread,
Jul 19, 2001, 5:58:40 PM7/19/01
to
Georg =?ISO-8859-1?Q?Maa=DF?= <ge...@bioshop.de> writes:

g++ ... -Wl,-rpath,/users/myproject/lib ...

NB : -rpath is specific to GNU ld

--
Martin

Arthur H. Gold

unread,
Jul 19, 2001, 5:53:35 PM7/19/01
to
Georg Maaß wrote:
>
> When I try to tell g++ where the compiled application should search at
> runtime for shared libraries, using the -rpath /users/myproject/lib/
> option I get this error message.
>
> g++: unrecognized option `-rpath'
>
> At runtime the application crashes at the first call of a function of
> the library. I guess that the library is not loaded at runtime which
> causes the crash.
>
> Are there any special restrictions on the usage of this option, or is
> this a bug in g++, or did I misunderstand something about this option?
>
> I used g++ 2.95.3, which was built to generated static output by de-
> fault. The application links everything static except this single
> shared library.

-rpath is an option of `ld', not `gcc/g++'. You need to use
`-Wl,-rpath,/users/....' to have it passed on to the linker.

Please see the info pages for gcc and ld for a complete description.

HTH,
--ag
--
Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info)
mailto:ag...@bga.com or mailto:ag...@cs.utexas.edu
--
"If you get to a fork in the road, take it." -- L. P. Berra

0 new messages