Go to the first, previous, next, last section, table of contents.

# Obtaining Source Code

- latest versions: What is the latest version of gcc, g++, and libg++?
- g++ for Unix: How do I get a copy of g++ for Unix?
- g++ for HP: Getting gcc/g++ for the HP Precision Architecture
- g++ for Solaris 2.x: Getting gcc/g++ binaries for Solaris 2.x
- g++ for other platforms: How do I get a copy of g++ for (some other platform)?
- 1.x vs 2.x versions: But I can only find g++-1.42!

## What is the latest version of gcc, g++, and libg++?

The latest "2.x" version of gcc/g++ is 2.7.2.1, released August 14, 1996. The latest version of libg++ is 2.7.2, released July 4, 1996.

Don't use 2.5.x, with x less than 5, for C++ code; there were some serious bugs that didn't have easy workarounds. 2.5.8 is the most solid 2.5.x release. 2.6.3 is the most solid 2.6.x release.

For some non-Unix platforms, the latest port of gcc may be an earlier version (2.5.8, say). You'll need to use a version of libg++ that has the same first two digits as the compiler version, e.g. use libg++ 2.5.x (for the latest x you can find) with gcc version 2.5.8.

The latest "1.x" version of gcc is 1.42, and the latest "1.x" version of g++ is 1.42.0. While gcc 1.42 is quite usable for C programs, I recommend against using g++ 1.x except in special circumstances (and I can't think of any such circumstances).

## How do I get a copy of g++ for Unix?

First, you may already have it if you have gcc for your platform; g++ and gcc are combined now (as of gcc version 2.0).

You can get g++ from a friend who has a copy, by anonymous FTP or UUCP, or by ordering a tape or CD-ROM from the Free Software Foundation.

The Free Software Foundation is a nonprofit organization that distributes software and manuals to raise funds for more GNU development. Getting your copy from the FSF contributes directly to paying staff to develop GNU software. CD-ROMs cost $400 if an organization is buying, or $100 if an individual is buying. Tapes cost around $200 depending on media type. I recommend asking for version 2, not version 1, of g++.

For more information about ordering from the FSF, contact gnu@prep.ai.mit.edu, phone (617) 542-5942 or anonymous ftp file ``ftp://prep.ai.mit.edu/pub/gnu/GNUinfo/ORDERS'` (you can also use one of the sites listed below if you can't get into "prep").

Here is a list of anonymous FTP archive sites for GNU software. If no directory is given, look in ``/pub/gnu'`.

    ASIA: ftp.cs.titech.ac.jp, tron.um.u-tokyo.ac.jp:/pub/GNU/prep
    cair-archive.kaist.ac.kr, ftp.nectec.or.th:/pub/mirrors/gnu

    AUSTRALIA: archie.au:/gnu (archie.oz or archie.oz.au for ACSnet)

    AFRICA: ftp.sun.ac.za

    MIDDLE-EAST: ftp.technion.ac.il:/pub/unsupported/gnu

    EUROPE: irisa.irisa.fr, ftp.univ-lyon1.fr,
    ftp.mcc.ac.uk, unix.hensa.ac.uk:/mirrors/uunet/systems/gnu,
    src.doc.ic.ac.uk:/gnu, ftp.ieunet.ie, ftp.eunet.ch,
    nic.switch.ch:/mirror/gnu, ftp.informatik.rwth-aachen.de,
    ftp.informatik.tu-muenchen.de, ftp.win.tue.nl, ftp.nl.net,
    ftp.etsimo.uniovi.es, ftp.funet.fi, ftp.denet.dk,
    ftp.stacken.kth.se, isy.liu.se, ftp.luth.se:/pub/unix/gnu,
    ftp.sunet.se, archive.eu.net

    SOUTH AMERICA: ftp.inf.utfsm.cl, ftp.unicamp.br

    WESTERN CANADA: ftp.cs.ubc.ca:/mirror2/gnu

    USA: wuarchive.wustl.edu:/systems/gnu, labrea.stanford.edu,
    ftp.digex.net, ftp.kpc.com:/pub/mirror/gnu, f.ms.uky.edu:/pub3/gnu,
    jaguar.utah.edu:/gnustuff, ftp.hawaii.edu:/mirrors/gnu,
    uiarchive.cso.uiuc.edu, ftp.cs.columbia.edu:/archives/gnu/prep,
    gatekeeper.dec.com:/pub/GNU, ftp.uu.net:/systems/gnu

The "official site" is prep.ai.mit.edu, but your transfer will probably go faster if you use one of the above machines.

Most GNU utilities are compressed with "gzip", the GNU compression utility. All GNU archive sites should have a copy of this program, which you will need to uncompress the distributions.

[ Warning: this information about UUCP access to UUNET and Ohio State is about five years old; I'm not sure if these services still exist. ]

UUNET customers can get GNU sources from UUNET via UUCP. UUCP-only sites can get GNU sources by "anonymous UUCP" from site "osu-cis" at Ohio State University. You pay for the long-distance call to OSU; the price isn't too bad on weekends at 9600 bps. Send mail to uucp@cis.ohio-state.edu or osu-cis!uucp for more information.

OSU lines are often busy. If you're in the USA, and are willing to spend more money, you can get sources via UUCP from UUNET using their 900 number: 1-900-GOT-SRCS (900 numbers don't work internationally). You will be billed $0.50/minute by your phone company.

Don't forget to retrieve libg++ as well!

## Getting gcc/g++ for the HP Precision Architecture

If you use the HP Precision Architecture (HP-9000/7xx and HP-9000/8xx) and you want to use debugging, you'll need to use the GNU assembler, GAS (version 2.3 or later). If you build from source, you must tell the configure program that you are using GAS or you won't get debugging support. A non-standard debug format is used, since until recently HP considered their debug format a trade secret. Thanks to the work of lots of good folks both inside and outside HP, the company has seen the error of its ways and has now released the required information. The team at the University of Utah that did the gcc port now has code that understands the native HP format.

There are binaries for GNU tools in ``ftp://jaguar.cs.utah.edu/dist/'`, but these are older versions.

Jeff Law has left the University of Utah, so the Utah prebuilt binaries may be discontinued.

## Getting gcc/g++ binaries for Solaris 2.x

"Sun took the C compiler out of Solaris 2.x. Am I stuck?"

You'll need to get prebuilt binaries from someone.

It used to be that you could get GCC binaries from prep.ai.mit.edu; these are no longer there.

The WWW site ``http://smc.vnet.net/solaris_2.5.html'` contains various GNU and freeware programs for Solaris2.5 running on the sparc. These are packaged to enable easy installation using the Solaris "pkgadd" utility. These include GNU emacs, gcc, gdb, perl, and others. These versions are more recent than the binaries at "prep" (gcc 2.7.2 and libg++ 2.7.1 are there).

## How do I get a copy of g++ for (some other platform)?

As of gcc-2.7.x, there is Windows NT support in gcc. Some special utilities are required. See the INSTALL file from the distribution. If you're interested in GNU tools on Windows NT, see ``http://www.cygnus.com/misc/gnu-win32/'` on the WWW, or the anonymous FTP directory ``ftp://ftp.cygnus.com/pub/gnu-win32/'`.

The standard gcc/g++ distribution includes VMS support for the Vax. Since the FSF people don't use VMS, it's likely to be somewhat less solid than the Unix version. Precompiled copies of g++ and libg++ in VMS-installable form for the Vax are available by FTP from ``ftp://mango.rsmas.miami.edu/pub/VMS-gcc/'`.

Klaus Kaempf (kkaempf@progis.de) has done a port to OpenVMS for the Alpha; this is not yet a part of the official gcc/g++. The port includes g++ and all libraries from the libg++ distribution. See ``http://www.progis.de'` for more details.

There are two different versions of gcc/g++ for MS-DOS: EMX and DJGPP. EMX also works for OS/2 and is described later. DJGPP is DJ Delorie's port. It can be found on many FTP archive sites; try ``ftp://ftp.coast.net/SimTel/vendors/djgpp/'` or, for a complete list, see ``http://www.delorie.com/djgpp/getting.html'`.

The latest version of DJGPP is 2.00. See ``http://www.delorie.com/djgpp/v2/'` for information on this version.

FSF sells floppies with DJGPP on them; see above for ordering software from the FSF.

DJGPP has its own newsgroup: ``comp.os.msdos.djgpp'`.

For information on Amiga ports of gcc/g++, retrieve the file
``ftp://prep.ai.mit.edu/pub/gnu/MicrosPorts/Amiga'`
or write to Markus M. Wild <wild@nessie.cs.id.ethz.ch>, who I hope won't be too upset that I mentioned his name here.

A port of gcc to the Atari ST can be found at
``ftp://atari.archive.umich.edu/atari/Gnustuff/Tos'` along with many other GNU programs. This version is usually the same as the latest FSF release. See the "Software FAQ" for the Usenet group ``comp.sys.atari.st'` for more information.

There are two different ports of gcc to OS/2, the so-called EMX port (which also runs on MS-DOS), and a port called "gcc/2". The latter port is no longer supported, since the EMX port includes all of its functionality. The EMX port's C library attempts to provide a Unix-like environment. For more information ask around on ``comp.os.os2.programmer.misc'`.

The EMX port is available by FTP from

    ftp://ftp.uni-stuttgart.de/pub/systems/os2/emx-0.9a
    ftp://src.doc.ic.ac.uk/pub/packages/os2/unix/emx09a
    ftp://ftp.informatik.tu-muenchen.de/pub/comp/os/os2/devtools/emx+gcc

Eberhard Mattes did the EMX port. His address is mattes@azu.informatik.uni-stuttgart.de.

I'm looking for more information on gcc/g++ support on the Apple Macintosh. Until recently, this FAQ did not provide such information, but FSF is no longer boycotting Apple as the League for Programming Freedom boycott has been dropped.

Versions 1.37.1 and 2.3.3 of gcc were ported by Stan Shebs and are available at
``ftp://ftp.cygnus.com/pub/mac'`

They are both interfaced to MPW. Stan is working on a version using the current (post-2.7) sources, contact him directly (shebs@cygnus.com) for more information.

## But I can only find g++-1.42!

"I keep hearing people talking about g++ 2.7.2 (or some other number starting with 2), but the latest version I can find is g++ 1.42. Where is it?"

As of gcc 2.0, C, C++, and Objective-C as well are all combined into a single distribution called gcc. If you get gcc you already have g++. The standard installation procedure for any gcc version 2 compiler will install the C++ compiler as well.

One could argue that we shouldn't even refer to "g++-2.x.y" but it's a convention. It means "the C++ compiler included with gcc-2.x.y."

Go to the first, previous, next, last section, table of contents.