delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/24/17:07:47

From: bowes AT mail DOT cgocable DOT net
Message-Id: <199804242107.RAA15311@mail.cgocable.net>
To: djgpp AT delorie DOT com
Date: Fri, 24 Apr 1998 17:06:29 +0000
MIME-Version: 1.0
Subject: Re: cout error
In-reply-to: <6hmete$ni7$1@nnrp1.dejanews.com>

> When i try to compile the hello.cpp program I get this error:
> c:\DJGPP>gxx hello.cpp -o hello.exe
> hello.cpp: In function 'int main(...)':
> hello.cpp:4: 'cout' undeclared (first use this function)

You need to include iostream.h at the top of your file:

#include <iostream.h>

> so I tried to compile
>  void main(void)
>  {
>  }
> i get:
> c:\DJGPP>gxx h.cpp -o h.exe
> c:\/djgpp/bin\ld.exe: cannot open -lgpp: No such file or directory (ENOENT)

Be sure your path points to the djgpp\bin directory and DJGPP is set 
to the djgpp.env

e.g. add these lines to autoexec.bat (assuming c:\djgpp is the right 
directory):

set path=c:\djgpp\bin;%path%
set DJGPP=c:\djgpp\djgpp.env


- Raw text -


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