SUMMARY : gcc can't find libg++

From: Marina Daniels (Marina.Daniels@cs.tas.gov.au)
Date: Sun Oct 31 1999 - 19:31:51 CST


Thanks very much to the following people,

Rachel Polanskis (who went to a lot of trouble to send me a copy of her libg++
package although unfortunately it didn't work for me)
Duane Gran
Bevan Broun
David Evans
Carolo Cosolo
Bryan Blackburn
Peter Wallis
Thomas Erikson
Phil Edwards
Peter DeQuoy
Eric Jones

sorry if I have missed anyone.

There were 2 issues: 1) making g++ work and 2) running "patch" on hylafax
software.

I got my 2 software packages from www.sunfreeware.com (gcc 2.7.2.3 and libg++
2.7.2)

I have got lots of software from here in the past without any problems - I still
think it's not really a problem with the software, just how I put it together.

I tried putting symbolic links from /usr/local/lib pointing to where the
libraries were in /opt. I set the environment variable LD_LIBRARY_PATH to point
to where the libraries were. (by the way there was no spelling error in the
real thing, just in the copy I sent to this mailing list).

Thomas suggested I use truss to see where it thought the errors were but it was
the hylafax "configure" script that was failing, and when I tried doing this
there was just too much output, it was hard to see.

David said that the version of gcc I was using did not support C++ so I should
recompile it,

and Bevan said

"You can tell the compiler where libraries with the -L option, similarly for
includes with the -I option.

For a bourne shell I would do.
export CC="gcc -L /opt/FSFlibg++/lib -I /opt/FSFlibg++/include"

and then configure hylafax's build. OR edit halafax's make file with these
options to gc"

I didn't actually try that, because I wanted to set up the compiler so that it
would work the way hylfax configure thought it should work.

Phil and Duane said I should use latest version of gcc 2.9.5

from Phil:

"The problem with a precompiled gcc is that several paths are built into
the compiler, the fixincludes scripts only change some of those. I
/highly/ recommend that you do the following:

1) Choose a new home for the compiler (/opt/gcc or /usr/local or
whatever you like), one that doesn't exist yet.
2) Download the gcc-2.7.whatever source, configure it with
"--prefix=/what/you/chose/in/previous/step" and build it using the
(precompiled) gcc you have now.
The lack of a C++ runtime system in your current gcc won't
matter;
only a working C compiler is needed to bootstrap gcc/g++/etc.
3) Do the same with the corresponding libg++ sources.
4) Remove (the pkgrm way) the precompiled gcc and libg++. 5) Do a
"make install" on your new compiler and libraries.

This will give you a c++ system with all of the correct paths built in.
I would also highly recommend that you work out the patching problem --
as somebody who's spent years monitoring gcc/g++ development, getting
the recent stable version is really worth it."

********************** WHAT I ACTUALLY DID:

In the end I got rid of the gcc and libg++ packages, and downloaded the
source code for both of them. I already have a sparc C compiler on the
system, so I used that to compile gcc 2.7.2.3 and then the libg++-2.7.2

My "env" is

=/usr/bin/env
PATH=/opt/SUNWspro/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/usr/loc
al/bin
TIFFINC=/usr/local/include
SHELL=/bin/ksh
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/opt/FSFlibg++/lib
LIBTIFF=-L/usr/local/lib -ltiff

When I compiled gcc and libg++ I didn't do anything out of the ordinary,
just accepted all the defaults.

PART 2) PATCH with HylaFAX 4.0pl2

I had to apply 2 patches to the HylaFAX program, one was for the leap
year and another was if you used gcc >= 2.8.0

The solaris patch program wouldn't recognize which files to patch and
would ask you, even if you told it, it failed. I tried different options
from the man page none of which fixed the problem.

>From Bryan:
"ftp://ftp.gnu.org/gnu/patch/ for source, or
http://www.sunfreeware.com/programlist.html#patch for binaries
It supports many more patch file formats than the Sun patch."

I got the GNU patch and I think it must be the correct one, because it
knew which files to patch but then some parts said they failed. In the
end I put in the leap year patch by hand because it was only a few
changes and quite obvious, but I couldn't do the gcc.2.8.x patch like
that because there was too much of it. Also I had heard from a few
people that they used gcc 2.7.2 to compile HylaFAX successfully so
that's why I chose to use that compiler instead.

*** ORIGINAL QUESTION ****
:
: I downloaded pre-compiled binaries of gcc-2.7.2.3 and
libg++-2.7.2 for
: solaris 2.6 and I have installed these using pkgadd and they are
now : in /opt where they are installed by default. I have run
"just-fixinc" :
: When I try to compile the hylafax program, I get the following
message
:
:
: "Missing C++ runtime support for gcc (/opt/GCC2723/bin/gcc)"
:
: It can't find the libg++ libraries which have been installed in
: /opt/FSFlibg++
:
: How do I tell gcc where libg++ is?
:
:
: ********My environment has :
: _=/usr/bin/env
: MANPATH=/usr/share/man:/usr/local/man
: HZ=100
: PATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/opt/GCC2723/bin
: EDITOR=/usr/bin/vi
: SHELL=/bin/ksh
: HOME=/
: LD_LIBRARY_PATH=/usr/lib:/usr/openwin/lib:/opt/FSFlibg++/lib:
: /opt/GCC723/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.3
:
: I cannot use a version of gcc >= 2.8.x because then I need to apply a
: patch to the hylafax program, which will not apply using the solaris
: patch program and I have no idea what patch program I am meant to use
: instead.
:
: I am positive this is just a problem with the compiler not knowing
: where the libraries are but I don't know how to make it find them.
:
: Any help appreciated
:
: Thanks
: Marina
:



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:31 CDT