User forums > Using Code::Blocks
Using g++
(1/1)
alexchen:
I have an existing projects that is cross platform. The source code is C++ but some has .cpp suffix and some has .c suffix.
Code::Blocks always uses 'gcc' for the .c file and 'g++' for .cpp and compilation fails if the is C++ syntax in the .c file, e.g. the 'new' operator. How do I force Code::Blocks to always use 'g++' for all source code? Or is there other ways to tell 'gcc' that it should treat the code as 'C++' code.
Thanks.
Alex
Jenna:
You can change the toolchain to always compile c-files with g++, but the correct way is not to use c++-code in c-files.
Everything else does not make sense.
Navigation
[0] Message Index
Go to full version