From: Nico Kadel-Garcia on
On Jul 23, 11:59 am, jny0 <j...(a)hotmail.com> wrote:
> Hi,
> I've just realised that g++ on my computer doesn't work properly.  I
> normally use gcc, so hasn't until now been a problem.  I read that g++
> is now part of gcc, but that I would need gcc-2.n.tar.gz, which I've
> dutifully downloaded.  When I try to create the makefile (using ./
> configure), I'm faced with the following error:
>
> gen-num-limits failed to build, exiting
>
> Any ideas?
> Regards

Somebody left out making sure you have a clean build environment, with
all the system requirements. These include tools like "libtool" and a
working compiler, and all of those requiements are pretty well defined
in the SRPM for Fedora. If you'd like to examine such building kit,
grab the SRPM and run "rpm --rebuild gcc-*.src.rpm", which contains
the tarballs and patches and settings to build things in a way
compatible with Fedora settings.

Building gcc is a pain in the keister, not because it's not amazing
code, but because it has to very carefully make sure header files
actually match POSIX standards, edit system files to provide working
local copies, build enough of a gcc code base to recompile gcc with
itself with all the desirable bits like g++ and gfortran turned on,
use *THAT* to rebuild gcc, then use that new version to rebuild gcc
again and make sure everything matches.

It's even more tricky for cross-compilation setups, which gcc
supports. And if you start hand-buiilding and replacing system
components, like gcc, with hand-built versions without putting them in
RPM's, you're going to cause serious chaos: your new compiler will be
unreported to package management, and expecting libraries to remain
compatible with two different compilers building them is.... oh, lord,
it's nasty.

It's fun and educational to build your own components for testing, but
keep them the heck out of /usr/bin and /usr/lib: Build them in /opt/
or /home/, to test out for yourself first.
From: John Hasler on
I don't use Fedora but a brief Google search tells me that

yum groupinstall "Development Tools"

should install everything you need.
--
John Hasler
jhasler(a)newsguy.com
Dancing Horse Hill
Elmwood, WI USA
From: mjt on
On Sun, 25 Jul 2010 07:49:06 -0700 (PDT)
jny0 <jny0(a)hotmail.com> wrote:

> What I learned came from:
> ftp://ftp.gnu.org/gnu/g++.README
> ...and says:
> G++ is no longer a separate distribution. Version 2 of G++

You're looking at a README from 1999. I would stay away from
the GNU website and get back to your Fedora distro and run
the "software installation tool" (I dont use Fedora so don't
know the tool's name) and do a search for "c++" and install it.

On my openSUSE 11.3 distro, there are separate selections for
the "C" and "C++" compilers:

gcc - The system GNU C Compiler
Version: 4.5-4.2
Package Group: Development/Languages/C and C++

gcc-c++ - The system GNU C++ Compiler
Version: 4.5-4.2
Package Group: Development/Languages/C and C++


--
Bugs, pl. n.:
Small living things that small living boys
throw on small living girls.
<<< Remove YOURSHOES to email me >>>

From: jny0 on
- John Hasler
Your search on Google must have used different criteria, because I've
been searching for some time, and never encountered:
yum groupinstall "Development Tools"
That said, while it seemed to load and install additional things, it
hasn't actually solved my problem. g++ still throws the same error.

- Nico Kadel-Garcia
Your idea regarding the SRPM; I thought that was a Red Hat thing.
I've done a search and found the following (relevant?) site:
http://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/
I'm not sure what I should be downloading, as the list is huge.
From: Richard Kettlewell on
jny0 <jny0(a)hotmail.com> writes:

> I'm using Fedora, and gcc was installed using the installation manager
> yum. I can compile c code using gcc (i.e. gcc test.c -o test), but
> not c++ code using g++ (i.e. g++ test.cc). When I try to do so I'm
> informed that the header file isn't recognised... Error: iostream.h:
> No such file or directory
>
> When investigating on the GNU website, I learned that g++ is now part
> of gcc, but that libstdc++-2.n.tar.gz would need acquiring and
> installing, as this contains iostream.h. I've done so but no no
> avail.
>
> This concludes the story so far!

Note that 'iostream.h' is correctly spelled just 'iostream' now.

$ cat t.cc
#include <iostream.h>
$ g++ -c t.cc
t.cc:1:22: error: iostream.h: No such file or directory
$ cat u.cc
#include <iostream>
$ g++ -c u.cc
$

--
http://www.greenend.org.uk/rjk/
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Clarifications needed to configure NFS client
Next: check