www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/18/19:13:32

Sender: nate AT cartsys DOT com
Message-ID: <367AED9A.6575DFE7@cartsys.com>
Date: Fri, 18 Dec 1998 16:04:42 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
CC: nilesh n chavan <nileshc AT yahoo DOT com>
Subject: Re: Can't make .exe
References: <000b01be2a44$8237f2c0$1de410ac AT nilesh>
Reply-To: djgpp AT delorie DOT com

> nilesh wrote:
> 
> Hi,
> I compiled the following code (the first one in c++) to get a .o file
> but could not link it to make an EXE file. Pl. help.
> 
> 
> First.cpp:
> 
> #include <iostream.h>
> 
> main()
> 
> {
> 
> cout << "This is my first C++ program.";
> 
> return 0;
> 
> }
> 
> Command Line :
> C:\>gcc -o first.exe first.o -L/djgpp/gcc281b/bin

As README.1ST tells you, use `gxx' to link C++ programs instead of
`gcc'.

And don't post in HTML.
 
> Error:
> 
> first.o: In function `main':
> c:\first.cpp:1: undefined reference to `cout'
> c:\first.cpp(.text+0x2e): undefined reference to `ostream::operator<<
> (char const *)'

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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