Date: Sat, 8 Nov 1997 12:32:36 -0800 (PST) Message-Id: <199711082032.MAA01373@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" To: =?iso-8859-1?Q?=22Bj=F6rn_Landsberg=22?= , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Compile and link C++ program Content-Transfer-Encoding: 8bit Precedence: bulk At 10:04 11/5/1997 +0100, Björn Landsberg wrote: >Hi, >Im just trying to get started with djgpp. >But I get error messages when I try to compile a simple hello world c++ >program. That is when i've included iostream.h and try to use: >cout << "bla bla..."; > >I get the message "undefined reference to cout". >If I use the -c option when I call gcc, wich skips the linking, I get no >errors. I also tried -O wich I read somewhere. > >Whats wrong? Ive read the helpfiles and desperatley tried various >combinations of different command-line arguments, without success. Did you read README.1ST? It says that to link a C++ program, you have to link the C++ libraries as well. A shortcut is to use `gxx' in place of `gcc', which does this for you. Nate Eldredge eldredge AT ap DOT net