public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Topham <dtopham@csuhayward.edu>
To: help-gcc@gnu.org
Subject: passing options through g++/gcc to linker
Date: Sat, 11 Dec 1999 17:28:00 -0000	[thread overview]
Message-ID: <3852F6E1.67C0A5E8@csuhayward.edu> (raw)
In-Reply-To: <82gfhm$5qu$1@gail.ripco.com>

I would like to compile/link a program on Unix (SunOS) using g++/gcc
that specifies where the runtime library resides on the host machine. I
read in these pages a suggestion to pass options to the linker in one of
these ways:

g++ -Wl,-rpath,<path>
or
g++ -Xlinker -rpath -Xlinker <path>

Yet, when I try that (although there are no messages from complier or
linker that I see)
and then do the "ldd" command to see what libs the runtime file (a.out)
will use,
it is the same as if I don't specify the path.

e.g.  <path> (in above commands) set to    /mydir/lib    (where my
libstdc++.so.2.8.1 resides)
I thought would change the output of:
ldd a.out
from
/opt/gnu/lib/libstdc++.so.2.8.1
 to
/mydir/lib/libstdc++.so.2.8.1

I still don't understand how this works yet. Can anyone enlighten me?
Thank you, Dave


WARNING: multiple messages have this Message-ID
From: Dave Topham <dtopham@csuhayward.edu>
To: help-gcc@gnu.org
Subject: passing options through g++/gcc to linker
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <3852F6E1.67C0A5E8@csuhayward.edu> (raw)
Message-ID: <19991231222400.2nVYvfxG_hxGq4ANKstYb-Z7quBOyuzHcEixX5BTMxE@z> (raw)
In-Reply-To: <82gfhm$5qu$1@gail.ripco.com>

I would like to compile/link a program on Unix (SunOS) using g++/gcc
that specifies where the runtime library resides on the host machine. I
read in these pages a suggestion to pass options to the linker in one of
these ways:

g++ -Wl,-rpath,<path>
or
g++ -Xlinker -rpath -Xlinker <path>

Yet, when I try that (although there are no messages from complier or
linker that I see)
and then do the "ldd" command to see what libs the runtime file (a.out)
will use,
it is the same as if I don't specify the path.

e.g.  <path> (in above commands) set to    /mydir/lib    (where my
libstdc++.so.2.8.1 resides)
I thought would change the output of:
ldd a.out
from
/opt/gnu/lib/libstdc++.so.2.8.1
 to
/mydir/lib/libstdc++.so.2.8.1

I still don't understand how this works yet. Can anyone enlighten me?
Thank you, Dave


  reply	other threads:[~1999-12-11 17:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-05 15:12 braces warning in DJGPP Blackbear
1999-12-06  6:04 ` Blackbear
1999-12-11 17:28   ` Dave Topham [this message]
1999-12-31 22:24     ` passing options through g++/gcc to linker Dave Topham
1999-12-31 22:24   ` braces warning in DJGPP Blackbear
1999-12-31 22:24 ` Blackbear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3852F6E1.67C0A5E8@csuhayward.edu \
    --to=dtopham@csuhayward.edu \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).