What C++ COMPILERS are available
There are two different version of C++ available on Athena, AT&T's
version called "cfront" and the GNU version, "g++".
USE
---
The AT&T version (now in its 2.0 release) translates your source code to
C, and then compiles it as normal C code. This can cause some problems.
If you get a warning about its code (not your code), for example, you
can usually ignore it. CC is currently available on the DEC platforms.
The GNU version is actually a direct C++ compiler. It is available for
the DEC, RS6000, Sun. and SGI workstations on Athena.
To use the AT&T version, type:
add c++
CC filename.C
and for the gnu version, type:
add cygnus
g++ filename.C
on a DEC, RS6000, or Sun, and type:
add gnu
g++ filename.C
on an SGI.
DIFFERENCES
-----------
There are several differences between the GNU and AT&T versions of C++:
- Each comes with its own set of header files to be included. In both
versions, if it can't find a C++ header file, it will fall back on the
corresponding C header file (which may not work as expected, so beware).
- .o files are not compatible between g++ and cfront.
- The syntax of the "new" statement differs slightly between the two versions.
DOCUMENTATION
-------------
There is a manual page for g++ in the gnu locker. To access it, just
type:
add gnu
man g++
In addition, there is an extended set of very helpful Emacs info files
available. To access them, first start up Emacs:
emacs
and inside Emacs type:
M-x info
When the info pages come up, you might want to go through the tutorial
to learn how to move around; you can access the tutorial by typing "h"
in the info pages.
After you've gone through the tutorial, try typing:
g
and then type in:
(/mit/gnu/info/dir)Top
to get to the top-level GNU info pages; from there you can go to the
section on "gcc" which also covers "g++".
There is not a lot of cfront specific documentation available. There
is a readme file in the C++ locker which itemizes the changes from
version 1.0 to version 2.0. The manual page documents the use of the
CC command. Some hardcopy documentation, including the 2.0 release
notes, is available in the consultants' office (1st floor N42). If
you wish, you may come over during our office hours to look at the
manual. I'm sorry, but we only have one copy, so we can't let you
remove it from the office.
BUGS
----
Bug reports on g++ and CC should be sent to bugs@mit.edu
Last Updated: 7/25/96
|