Using C++ Compilers on Odin

There are two C++ compilers on odin.cair.du.edu.

The first is the native DEC compiler, with the name cxx.

The second is the GNU compiler, with the name g++.

The native DEC compiler has the advantage of speed and full manual page description

The GNU compiler has the advantage of more-nearly ANSI draft behavior

The Native DEC Compiler

Path to compiler:
/usr/bin
Common flags:
-Ixxx
Include directory xxx before standard include directories. Several of these may be provided. NEVER use absolute pathnames in an include statement
-w0
Suppress no warnings (strongly recommended!)
-g
Enable line debugging information
-ms
Makes the compiler interpret features (including templates) like MSVC++
-distinguish_nested_enums
If you are using the same enumerated type name nested inside two different classes, you must use this flag to distinguish between them. I can't imagine why this isn't the default.
Quirks:
Caution: Standard use of the cxx compiler leaves data in a directory called cxx_repository, which can be an unexpected source of disk usage!

The newest DEC compiler handles templates and standard include file names nicely, but does not fully support namespaces yet.
The DEC compiler supports a useful subset of the proposed ANSI C++ standard exception handling mechanism.
The DEC compiler does not report unused variables
Version
DIGITAL C++ V6.1-029 on DIGITAL UNIX V4.0 (Rev. 564)
Manual Page
DEC C++ Compiler Manual Page

The GNU Compiler

Path to compiler:
/local/packages/gnu/bin
Common flags:
-Ixxx
Include directory xxx before standard include directories. Several of these may be provided. NEVER use absolute pathnames in an include statement!
-g
Enable line debugging information
-Wall
Display all common warnings (strongly recommended!)
-pedantic
Be especially picky
Quirks:
The GNU C++ compiler does provide extensions to the standard C++ language, as seen fit by the developers. Developers should watch these so as not to become reliant upon them! Examples are: local arrays dimensioned by a variable value and lenient treatment of functions without a prototype.

The GNU C++ compiler supports the proposed ANSI C++ standard template definition mechanism.
The GNU C++ compiler supports a reasonable subset of the proposed ANSI C++ standard exception handling mechanism
The GNU C++ compiler supports a subset of the proposed ANSI C++ standard include file naming conventions
The GNU C++ compiler does not yet support namespaces well enough to use them
This version issues a spurious message about exception code in objects with every link. No problems have been reported related to this, so ignore the message!
Version:
gcc version 2.8.1
Manual Page
GNU C++ Compiler Manual Page