User forums > Using Code::Blocks

cpp files with extensions in "c++"

(1/1)

seb_seb0:
Hello,

I have (had) a stupid problem.
I am trying to compile a library. In this lib, all the source files have the extension "c++", instead of the traditional "cpp".
Codeblocks does not recognize them as c++ files by default (they are displayed under the folder "others" in the project manager)

My question is: is there an option somewhere which allows to define the source files extensions ? I did not find it.

For the record, I have solved my problem by renaming the files in ".cpp" using a batch file. But there must be a better way.

Sebastien

MortenMacFly:
Right click on your project, select "project tree" and play with "categorize and file types" until you found your preferred setup.

seb_seb0:
OK, maybe I found it : in Project Manager, right click, select "Project Tree" / "Edit Files types & Categories"
In the dialog box, select the category "Sources" and add "*.c++".
This will be enough to make CB recognize the file and compile it when building.


Furthermore, to enable syntax highlighting for these files, go in "settings" / "editor". Click on "Syntax Highlighting" category, select "C/C++" and click on the button "filemasks".

seb_seb0:

--- Quote from: MortenMacFly on February 18, 2011, 10:29:34 pm ---Right click on your project, select "project tree" and play with "categorize and file types" until you found your preferred setup.

--- End quote ---

Cross post.
Thanks Morten !

Navigation

[0] Message Index

Go to full version