Subject: Re: g++ compilation header difficulties (where are they?)
From: "Al Slater" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 27 Apr 2005 19:52:16 +0100

Russell Martin wrote:
> program only results in a "No such file or directory" error.  Using
> "find", I can only locate (for example) "stdlib.h" and there is no file
> "stdlib" anywhere.  I do have a file "iostream" in the

I beleive the header you want is cstdlib.

> euler.cpp: In function `int main(int, char**)':
> euler.cpp:21: error: `string' undeclared (first use this function)
> euler.cpp:21: error: (Each undeclared identifier is reported only once
> for each function it appears in.)
> euler.cpp:21: error: parse error before `;' token

string is in the std namespace so try std::string or add "using
namespace std;" near the top of your file.

> -----
> Despite the fact that the header file "string" is located in the
> directory /usr/include/c++/3.3.3 the compiler seemingly can't locate
> it.  This is puzzling since it lists this path in the #include
> search path above.  Even placing the source code into the
> /usr/include/c++/3.3.3 directory and trying to compile it there gives
> the same error.  What am I overlooking here, or not understanding?

Why do you think it was not found, the compiler did not output any error
messages indicating this.

- --
Al Slater

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/