C++ Compilers

C++ compilers are a great adventure! Because the language is still changing, and because it is (very) difficult to write one, compilers are not all at the same stage. I will try to put some basic info here and perhaps update it as we get more experience. You may also want to have a look at the list of free compilers.

There are two sorts of compiler, preprocessors and native.

Preprocessors

These compilers convert the code into C, and then compile the C. They have to provide their own libraries for C++ classes (e.g. iostream) and also static constructors, so the C code cannot be compiled indepdently. The two best known ones are cfront and g++.

cfront

This has been developed by AT&T. It's not PD. It's licensed by a number of manufacturers - I use it on SGI where it is called CC. (It's possible to dump out the C code if you like puzzles and lots of nested brackets). V2.1 was very different from V3.

g++

This is probably the most widely used compiler among the participants. It's free and has a number of ancillary classes. It tracks the ANSI standard fairly well and has implemented templates. I believe it runs on any machine on which gcc runs. It also runs on PC's (I don't know whether it runs under Windows - ceratinly under DOS (I have djgpp). I don't know whether it is in phase with the UNIX versions It does NOT run on the MAC - Stallman has a policy about (not) porting to the MAC.

Current version of g++ is 2.5.8 (May 1 1994) Machines on which g++ is believed to run: SunOS, IRIX(SGI), HP-UX, Cray. Much more info, also how to get the compiler (and the GNU debugger) is in the g++ FAQ. Laura Pearlman pointed us to g++ and gdb (the GNU debugger) information sources at the Cygnus Support Online Library.

To know your own version of g++ and whether it's properly installed, type

g++ -v The answer should somehow look like this (for my system): gcc -v Reading specs from /gnu/lib/gcc-lib/mips-sgi-irix5/2.5.8/specs gcc version 2.5.8 You get this answer because g++ is just sitting on top of gcc, the GNU C compiler.

Native Compilers

These compilers are written by a speciific manufacturer for a specific target machine, so although they may follow the standard they will also use other addititions (e.g. their own classes and debuggers). Therefore take care when using them that you still manage to write portable code.

Borland (PC: DOS and Windows)

I bought this and like it. there are several components, e.g. DOS only, DOS + IDE, Windows (compiler), Windows (development kit). I'm probably already out of date. The DOS is command-line driven witha makefile like UNIX. It can suffer from memory for large classes like mine. (Both compile and run may fail). The IDE is a very nice development environment which allows you to step thru the program, examine contents of classes, set break points, etc. Worth using.
The windows version has fewer (none?) memory problems. The development kit also allows you to develop GUIs but unless you are into that, there's no need to buy it.
Borland has HUGE number of flags which the user can set. If they get this wrong, then it can give very wierd errors. So I suggest a king student posts a suggested list of Borland flags. (king -> kind). The other problem (for the course) is that I don't know how to extract erros into a file, so it may not be easy to post them. Again. a volunteer who can write a useful guide to Boarland would be appreciated.
Current version is 4.0.

Symantec

I think this used to be Zortech. It is avaialble of the MAC and (presumably) PC?

Microsoft

Last time I heard this was up to V7. I know no details

Sun

No details

HP

No details

DEC

No details

RS600

No details

Apple Macintosh: Separate file.

Volunteer(s) Wanted To Keep This List Up To Date - PeterMR :-)


ms