delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/29/11:12:56

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I did it
Date: 29 Apr 1997 13:12:11 GMT
Organization: Oxford University, England
Lines: 22
Message-ID: <5k4s3b$edf@news.ox.ac.uk>
References: <199704290641 DOT IAA21817 AT gilberto DOT physik DOT rwth-aachen DOT de>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019