02198, January 2002

49423 Homepage
Course Material
C++ software
Web Sites
E-bar/G-bar
FAQs
IMM/CST
H H  

Informatics and Mathematical Modelling

Computer Science and Technology

H H H
H H H I I H H
H H H
H H H  for those who know Java

Ebar & Gbar

Terminals

Students attending this course have access to 

  1. the terminals in the G-bar, build. 308.
  2. terminals in the Ebar, building 341.

C++ Compiler

In the Ebar the default GNU C++ compiler is gcc 2.95.3.

In the Gbar the default GNU C++ compiler is  gcc 2.8.1. If you have problems with compilation of ANSI C++ programs you may change to the new gcc  2.95.2 by setting the environment variable GCC_VERSION to 2.95.2 :

setenv GCC_VERSION 2.95.2

You can enter the command above in the terminal window where you run make or put it in your tcshell setup-file .tcshrc . You can always see the version of the c++ compiler you are using by typing g++ -v .

Call of compiler:

g++ compile and link
g++ -c compile, do not link
g++ -o file place output-file in file
g++ -O1
g++ -O2
compile and optimize
g++ -v print version number of gcc

All combinations of the above shown parameters may be used.

Emacs

When editing C++ programs you can have highlighted syntax. If you don't have it, just use the menu Help/Options/GlobalFontLock.

When your program consist of many files use the speed-bar to easily change from one file to another and move to the source for a specific class method, Menu: Tools/DisplaySpeedbar.

If you have a makefile you can compile from inside emacs, Menu: Tools/Compile Return.

Emacs Help:

Emacs quick reference card
Emacs quick reference card (postscript, pdf)
Emacs manual
CC mode
For customization of emacs see The very unofficial dotemacs home.

Book Examples

The program examples in the book: C++ for C programmers is available from addison-wesley. However, the source seems to contain bad line-shifts (13's) which the egcs-compiler does not like. The source text with correct line-shift's (10's) is available here. In the Linux-bar the source text can also be taken from the catalog  

~v0283/kurser/49423/book-exs/ .

C++ Library Reference

Remember, you have a full C++ Library Reference available at Dinkum C++ Library Reference

 

Hans Bruun (hab@imm.dtu.dk) 17-12-2001