The only tangible difference between choosing C vs C ++ when creating a project is which compiler is called for the translation units at build time. Currently, code blocks make it impossible to directly change this after creating a project. That is, you will have to change each source file one at a time to get what you want.
Here you can change it:
Now, if your existing project contains many source files, you can do it faster by manually editing the cbp codeblocks project file (it's just an xml file). The nodes you want to find and replace will look something like this:
<CodeBlocks_project_file> //... <Project> //... <Unit filename="source1.cpp"> <Option compilerVar="CPP" /> //change CPP to CC here </Unit> <Unit filename="source2.cpp"> <Option compilerVar="CPP" /> // and here </Unit> <Unit filename="source3.cpp"> <Option compilerVar="CPP" /> // and here then save. </Unit> //... </Project> </CodeBlocks_project_file>
After the changes open your project in C :: B and confirm that it is compiled as the source file C. You should see the build log referencing gcc now instead of g ++.
greatwolf
source share