| delorie.com/archives/browse.cgi | search |
| Message-ID: | <000b01be2a44$8237f2c0$1de410ac@nilesh> |
| From: | "nilesh" <nilesh AT ncdc DOT com> |
| To: | <djgpp AT delorie DOT com> |
| Cc: | "nilesh n chavan" <nileshc AT yahoo DOT com> |
| Subject: | Can't make .exe |
| Date: | Thu, 17 Dec 1998 23:08:52 -0600 |
| MIME-Version: | 1.0 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Mailer: | Microsoft Outlook Express 5.00.0518.4 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.0518.4 |
| Reply-To: | djgpp AT delorie DOT com |
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01BE2A12.36CC7720
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=20
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
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 *)'
------=_NextPart_000_0008_01BE2A12.36CC7720
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 5.00.0518.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Hi, </FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>I compiled the =
following code (the=20
first one in c++) to get a .o file but could not link it to make an EXE =
file.=20
Pl. help.</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>First.cpp:</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2><FONT face=3D"Courier =
New" size=3D2>
<P>#include <iostream.h></P>
<P>main()</P>
<P>{</P>
<P>cout << "This is my first C++ program.";</P>
<P>return 0;</P>
<P>}</FONT></FONT></P></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Command Line =
:</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>C:\>gcc -o first.exe =
first.o=20
-L/djgpp/gcc281b/bin</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>Error:</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2><BR>first.o: In =
function=20
`main':<BR>c:\first.cpp:1: undefined reference to=20
`cout'<BR>c:\first.cpp(.text+0x2e): undefined reference to=20
`ostream::operator<< (char const *)'<BR></FONT></DIV>
</BODY></HTML>
------=_NextPart_000_0008_01BE2A12.36CC7720--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |