Author Topic: cpp files with extensions in "c++"  (Read 5679 times)

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
cpp files with extensions in "c++"
« 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: cpp files with extensions in "c++"
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: cpp files with extensions in "c++"
« Reply #2 on: February 18, 2011, 10:37:42 pm »
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".


Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: cpp files with extensions in "c++"
« Reply #3 on: February 18, 2011, 10:39:05 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 !