Mail Archives: djgpp/1997/04/29/11:12:56
Christoph Kukulies (kuku AT gilberto DOT physik DOT rwth-aachen DOT de) wrote:
: > Thanks to everyone, I have compiled my first little program called
: > Hello.cc. I must have typed hello.exe 1000 times. The only problem I had
: > was gcc didnt seem to work. So I used gxx. Gcc gave me alot of error
: > mesages and I thought I would take a chance and us gxx. It worked, and
: > all I want to know is why it didnt work with gcc.
: What was the name of your program 'hello' ? Was it hello.c?
: Should should name it hello.cc to make sure gcc (the compiler driver)
: invokes the correct compilers and preprocessors.
...and in addition, if you use certain C++ features you must link in
additional libraries - for example, if you use iostreams you need to pass
`-liostr' to gcc at the link stage. If you use gxx you don't have to do
this. I suspect this is why you were having problems.
In short, if it's C++, name it accordingly (.cc, .cpp or .C) and use gxx
to link it.
--
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford
- Raw text -