This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: realpath() function not declared in scope when "-std=c++11" option added to g++
- From: Csaba Raduly <rcsaba at gmail dot com>
- To: cygwin list <cygwin at cygwin dot com>
- Date: Wed, 2 Mar 2016 09:55:29 +0100
- Subject: Re: realpath() function not declared in scope when "-std=c++11" option added to g++
- Authentication-results: sourceware.org; auth=none
- References: <CAFifAWutgmwLdZJzfeDUdg2RFhfhgNYDaYTrqjXzSZzO0A67Dg at mail dot gmail dot com>
Hi MyBig,
On Wed, Mar 2, 2016 at 7:58 AM, MyBig SpamEmail wrote:
>
> Compiling the following code in test.cpp:
>
> #include <limits.h>
> #include <stdlib.h>
>
> int main ( void )
> {
> realpath ( "//.", NULL );
> return 0;
> }
>
> This works:
> % g++ test.cpp
>
> This doesn't:
> % g++ -std=c++11 test.cpp
> test.cpp: In function âint main()â:
> test.cpp:8:25: error: ârealpathâ was not declared in this scope
> realpath ( "//.", NULL );
> ^
I don't have a Cygwin machine at hand, but try compiling with
-std=gnu++11 instead of -std=c++11. realpath() might be hidden if
__STRICT_ANSI__ is defined (when you use -std=c++11, IIRC).
Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple