Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: seb_seb0 on February 18, 2011, 10:26:05 pm
-
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
-
Right click on your project, select "project tree" and play with "categorize and file types" until you found your preferred setup.
-
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".
-
Right click on your project, select "project tree" and play with "categorize and file types" until you found your preferred setup.
Cross post.
Thanks Morten !