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

trouble with LD_LIBRARY_PATH and g++

19 views
Skip to first unread message

Brian Merrill

unread,
Mar 11, 1999, 3:00:00 AM3/11/99
to
Hi,
I've recently installed g++ on Solaris 7 from www.sunfreeware.com.
According to the documentation, I am supposed to modify LD_LIBRARY_PATH to
include /usr/local/lib which I've done as can be verified by doing an echo
$LD_LIBRARY_PATH. However, when I try to compile using g++ it still says No
such file or directory on string.h and stdlib.h. This happens both when I
am logged in as root or as a normal user. When I am logged in as a normal
user, however, it says Undefined variable even though I've modified both the
.cshrc and .profile files. Any information on this confusing topic would be
greatly appreciated.
Thanks,
Brian Merrill
merr...@uswest.net

Jim Stephens

unread,
Mar 12, 1999, 3:00:00 AM3/12/99
to

first, LD_LIBRARY_PATH has nothing to do with the include files, which
are what string.h and stdlib.h are.

you need to examine the gcc command that is invoked by your make (I
assume you are using make to do this) and see if you can see if you
have the proper directories set up to your includes.

when you explicitly set LD_LIBRARY_PATH, you sometimes have to also
include other libraries you have on the platform, such as /usr/lib and
/usr/openwin/lib as well, because LD_LIBRARY_PATH will only search
what you explicitly specify.

there is a way on solaris to eliminate the need for LD_LIBRARY_PATH,
but I don't recall what it is, and it may require you get a sun
compiler to accomplish it. someone else familiar with this may
comment on that.

basically you need to understand the difference between the libs and
the header files.

Jim

Mac Schwarz

unread,
Mar 12, 1999, 3:00:00 AM3/12/99
to
>> "JS" == Jim Stephens <jwste...@home.nospam.com> writes:

JS>[...]

JS> there is a way on solaris to eliminate the need for
JS> LD_LIBRARY_PATH, but I don't recall what it is, and it may require
JS> you get a sun compiler to accomplish it. someone else familiar
JS> with this may comment on that.

JS> basically you need to understand the difference between the libs
JS> and the header files.

JS> Jim

Some days ago David Barr postet an URL to his explanation, why the
LD_LIBRARY_PATH is 'bad'
(http://www.cis.ohio-state.edu/~barr/ldpath.html). He gives a hint how
to eliminate the LD_LIBRARY_PATH also (take a look at the -R option in
the ld manpage).

Regards,
mac

--
mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: m...@aeria.phil.uni-erlangen.de / Tel.: 09131-85-24791
FAU Erlangen-Nuernberg / Kochstr.4 / 91054 Erlangen
<http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>

0 new messages