delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/07/06/14:20:48

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Thu, 6 Jul 2006 14:20:23 -0400
Message-Id: <200607061820.k66IKNhu031068@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <1152209580.035172.149660@s26g2000cwa.googlegroups.com>
(readmylips AT my-deja DOT com)
Subject: Re: Mystified by compiling
References: <1152209580 DOT 035172 DOT 149660 AT s26g2000cwa DOT googlegroups DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> This is the error it gives me:
> randgen.cpp: In function 'int main(int, char**)':
> randgen.cpp:1166: error: 'getcwd' was not declared in this scope
> randgen.cpp:1168: error: 'chdir' was not declared in this scope

> So is this a bug in their code or a error in my use or configuration of
> the compiler?

It's a bug in their code.  You need to add this line near
the top of the file:

#include <unistd.h>

Also, you may want to use gpp or g++ instead of gcc, so that all the
C++ libraries are linked in.

- Raw text -


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