Xcode warnings just after new c++ project creation

Xcode warnings just after new c++ project creation

It took me a while to find the reason and the solution to this, so i wish to be handy to those that still use xcode 3.

The fact:

I just created a New Project > Command Line Tool ( but this happen with probably any c++ project ) and 2 warnings suddenly show in Xcode 3.2.4:

The option ‘-D_GLIBCXX_DEBUG=1′ should not be passed to GCC 4.2 and has been automatically suppressed.

and

The option ‘-D_GLIBCXX_DEBUG_PEDANTIC=1’ should not be passed to GCC 4.2 and has been automatically suppressed.

This happen systematically after an Xcode upgrade on 10.6, it should actually be a bug fix, or better a workaround, that xcode folks performed on 10.5 and forgot to remove later. There could still be some issues using debug mode and STL by the way. If you need those flags in Debug Mode you can maybe fall back to GCC 4.0.

The solution:

To fix it in the actual project just remove those 2 key from project properties > build > search for them…

To permanently fix it in next project delete/comment the 2 corresponding lines in this file (right-click on C++Tool.xcodeproj > Show Package Content)

/Developer/Library/Xcode/Project Templates/Application/Command Line Tool/C++ Tool/C++Tool.xcodeproj/project.pbxproj

around at line 148:

/*"_GLIBCXX_DEBUG=1",
"_GLIBCXX_DEBUG_PEDANTIC=1",*/

This for default C++ projects, same procedure for different kind of c++ projects.

Leave a Reply