News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

cpp files with extensions in "c++"

Started by seb_seb0, February 18, 2011, 10:26:05 PM

Previous topic - Next topic

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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.

Cross post.
Thanks Morten !