Re: GCC 4.2 parse error in stl_algobase.h: "current namespace 'std' does not enclose..."
Re: GCC 4.2 parse error in stl_algobase.h: "current namespace 'std' does not enclose..."
- Subject: Re: GCC 4.2 parse error in stl_algobase.h: "current namespace 'std' does not enclose..."
- From: Howard Hinnant <email@hidden>
- Date: Tue, 25 Aug 2009 19:28:03 -0400
On Aug 25, 2009, at 6:26 PM, Jens Alfke wrote:
I have a small C++ based project that I created from the "C++ Tool"
template last week. I just switched its compiler version from GCC
4.0 to 4.2. Now the Release config builds, but the Debug config
fails with a compile error when I #include <algorithm>:
In file included from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/
4.0.0/bits/stl_algobase.h:64,
from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/
4.0.0/algorithm:65,
from /Code/SafeStorage/Hash.cpp:12:
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/i686-apple-
darwin9/bits/c++config.h:79: error: current namespace 'std' does not
enclose strongly used namespace '__gnu_debug_def'
The line in <stl_algobase.h> where the error occurs is:
using namespace __gnu_debug_def __attribute__ ((strong));
The GCC version string is "i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1
(Apple Inc. build 5574)". I've got Xcode 3.1.3, which I believe is
the latest. This is on a MBP running 10.5.8. Any suggestions?
When using 4.2, disable _GLIBCXX_DEBUG (debug mode for the std::lib).
You can do this in Xcode by editing the Active Target. Make sure the
configuration is Debug. Search for "preprocess". Remove
"_GLIBCXX_DEBUG=1 _GLIBCXX_DEBUG_PEDANTIC=1" from Preprocessor Macros.
-Howard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden