public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* More than one lib file
@ 2000-03-09 13:45 greg zhang
  2000-03-10  0:38 ` Martin v. Loewis
  2000-04-01  0:00 ` greg zhang
  0 siblings, 2 replies; 6+ messages in thread
From: greg zhang @ 2000-03-09 13:45 UTC (permalink / raw)
  To: gcc-help

Hi,

Now, I have a question about gcc and libstdc++ lib.

In a server machine, there are two different lib
files(libstdc++), how to let everyone link correct lib
when they build their differenet projects.
Maybe they build simultaneously, so I can't modify lib
directory manually.

I try to modify lib directory in Makefile, such as
/usr/local/lib, or /usr/local/lib2, ...

(through change envirment variable LD_LIBRARY_PATH =
one of them)

It seems gcc always search and link the previous lib
file(/usr/local/lib).

So, could give me a advice how and where to begin
this?

Thanks.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

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

* Re: More than one lib file
  2000-03-09 13:45 More than one lib file greg zhang
@ 2000-03-10  0:38 ` Martin v. Loewis
  2000-03-10  0:52   ` Alexandre Oliva
  2000-04-01  0:00   ` Martin v. Loewis
  2000-04-01  0:00 ` greg zhang
  1 sibling, 2 replies; 6+ messages in thread
From: Martin v. Loewis @ 2000-03-10  0:38 UTC (permalink / raw)
  To: gregzh; +Cc: gcc-help

> So, could give me a advice how and where to begin
> this?

Are they using two different gcc installations as well? If so, you can
put libstdc++ into the directory where cc1plus lives; gcc will pick it
up from there. After you've made the change, you should verify with
gcc -v that it does the right thing.

Regards,
Martin

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

* Re: More than one lib file
  2000-03-10  0:38 ` Martin v. Loewis
@ 2000-03-10  0:52   ` Alexandre Oliva
  2000-04-01  0:00     ` Alexandre Oliva
  2000-04-01  0:00   ` Martin v. Loewis
  1 sibling, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2000-03-10  0:52 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: gregzh, gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

On Mar 10, 2000, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> wrote:

>> So, could give me a advice how and where to begin
>> this?

> Are they using two different gcc installations as well? If so, you can
> put libstdc++ into the directory where cc1plus lives; gcc will pick it
> up from there. After you've made the change, you should verify with
> gcc -v that it does the right thing.

It's not just a matter of GCC finding the right library: if it's a
dynamic library, the executable will have to find it too, and that's
where the problems may start.  If the library sonames are different,
there should be no problem if both are in /usr/local/lib.  But if
they're not, you may have to add -R/path/to/the/right/library to the
link command in order for the executable to find the appropriate
library at run-time.

-- 
Alexandre Oliva     http://www.ic.unicamp.br/~oliva/     Enjoy Guaraná
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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

* Re: More than one lib file
  2000-03-10  0:52   ` Alexandre Oliva
@ 2000-04-01  0:00     ` Alexandre Oliva
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Oliva @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: gregzh, gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

On Mar 10, 2000, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> wrote:

>> So, could give me a advice how and where to begin
>> this?

> Are they using two different gcc installations as well? If so, you can
> put libstdc++ into the directory where cc1plus lives; gcc will pick it
> up from there. After you've made the change, you should verify with
> gcc -v that it does the right thing.

It's not just a matter of GCC finding the right library: if it's a
dynamic library, the executable will have to find it too, and that's
where the problems may start.  If the library sonames are different,
there should be no problem if both are in /usr/local/lib.  But if
they're not, you may have to add -R/path/to/the/right/library to the
link command in order for the executable to find the appropriate
library at run-time.

-- 
Alexandre Oliva     http://www.ic.unicamp.br/~oliva/     Enjoy Guaraná
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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

* Re: More than one lib file
  2000-03-10  0:38 ` Martin v. Loewis
  2000-03-10  0:52   ` Alexandre Oliva
@ 2000-04-01  0:00   ` Martin v. Loewis
  1 sibling, 0 replies; 6+ messages in thread
From: Martin v. Loewis @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gregzh; +Cc: gcc-help

> So, could give me a advice how and where to begin
> this?

Are they using two different gcc installations as well? If so, you can
put libstdc++ into the directory where cc1plus lives; gcc will pick it
up from there. After you've made the change, you should verify with
gcc -v that it does the right thing.

Regards,
Martin

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

* More than one lib file
  2000-03-09 13:45 More than one lib file greg zhang
  2000-03-10  0:38 ` Martin v. Loewis
@ 2000-04-01  0:00 ` greg zhang
  1 sibling, 0 replies; 6+ messages in thread
From: greg zhang @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gcc-help

Hi,

Now, I have a question about gcc and libstdc++ lib.

In a server machine, there are two different lib
files(libstdc++), how to let everyone link correct lib
when they build their differenet projects.
Maybe they build simultaneously, so I can't modify lib
directory manually.

I try to modify lib directory in Makefile, such as
/usr/local/lib, or /usr/local/lib2, ...

(through change envirment variable LD_LIBRARY_PATH =
one of them)

It seems gcc always search and link the previous lib
file(/usr/local/lib).

So, could give me a advice how and where to begin
this?

Thanks.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-09 13:45 More than one lib file greg zhang
2000-03-10  0:38 ` Martin v. Loewis
2000-03-10  0:52   ` Alexandre Oliva
2000-04-01  0:00     ` Alexandre Oliva
2000-04-01  0:00   ` Martin v. Loewis
2000-04-01  0:00 ` greg zhang

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