www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/29/10:45:15

From: Mark Cowan <mark DOT cowan AT studentmail DOT newcastle DOT edu DOT au>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems while linking programs--
Date: Wed, 29 Dec 1999 18:23:24 -0800
Organization: The University of Newcastle
Lines: 60
Message-ID: <386AC21B.39B05CB3@studentmail.newcastle.edu.au>
References: <Fx7a4.470$eq DOT 5577 AT uutiset DOT nic DOT fi>
NNTP-Posting-Host: c52h1-asy5.newcastle.edu.au
Mime-Version: 1.0
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Marko Lokkila (Procyon)" wrote:

> Program source:
>
> test.cpp------------
>
> #include <iostream.h>
>
> void main()
> {
>    cout<<"Hiya.";
>    cin.get();
> }
>
> ------------------------
>
> When trying to make that to an .exe file, using the command
>
> gcc test.cpp -o test.exe
>
> I get the following errors:
>
> f:/djgpp/tmp\ccdaaaaa(.text+0x11):testi.cpp: undefined reference to `cout'
> f:/djgpp/tmp\ccdaaaaa(.text+0x16):testi.cpp: undefined reference to
> `ostream::operator<<(char const *)'
> f:/djgpp/tmp\ccdaaaaa(.text+0x20):testi.cpp: undefined reference to `cin'
> f:/djgpp/tmp\ccdaaaaa(.text+0x25):testi.cpp: undefined reference to
> `istream::get(void)'
>
> Any help would be appreciated. There are no problems with compiling the
> programs, they only arise when trying to build .exe files.
>
>     ML -- AKA Procyon
>
> --
> Reality is that which, when you stop believing in it, doesn't go away.
>                                Procyon AT nic DOT NoSpam DOT fi
>          Merry Christmas to All and welcome to the new Millenium

Mark,

instead of

gcc test.cpp -o test.exe

try

gxx test.cpp -o test.exe


Mark


--
_____________________________________________

Mark Cowan
Newcastle Australia


- Raw text -


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