Xcode C++ project adds C style header formate to new files

bugxcode

I just started using XCode to do basic C++ programming. I have noticed something strange.

When Im working on a C++ project, and want to add a new C++ source file, the automatic generated file is formated as a C file, even though its extention is .cpp.

Im using Xcode 6.1.1. I was a member of the Mac OSX public beta program, but I think I use the released version of Xcode.

Can anybody reproduce this bug, or is it just my system that got this bug? If so, how could I fix it?

This is what a typical automatic created header file look like:

//
//  testfunk.h
//  Test
//
//  Created by Jørgen Rørvik on 16.01.15.
//  Copyright (c) 2015 Jørgen Rørvik. All rights reserved.
//

#ifndef __Test__testfunk__
#define __Test__testfunk__

#include <stdio.h>

#endif /* defined(__Test__testfunk__) */

Best Answer

The Xcode template for C++ files does have #include <stdio.h>. To change this you have to create a template of your own - See several Stack Overflow questions here or here