How do I create a C-only project?

General questions regarding the usage of CodeLite
teovilo
CodeLite Curious
Posts: 2
Joined: Fri Dec 01, 2023 4:29 am
Genuine User: Yes
IDE Question: C++
Contact:

How do I create a C-only project?

Post by teovilo »

Codelite is one of the few lightweight IDE's for Windows but I'm frustrated that it treats C as a second class language. Despite advertising as a C/C++ IDE, there is only an option to create C++ projects. Obviously you can add C source/header files to a C++ project however, using "Add new file" defaults to *.cpp file names.

When compiling one of these projects, the g++ compiler is invoked even though it's not needed for a C-only project. I haven't found a way to disable this.

Is it possible to create a C-only workspace?

User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How do I create a C-only project?

Post by eranif »

You can simply rename the file to .c , by doing so, the compiler invoked will be gcc and not g++
Once renamed, you can right click and save the project as a template for future use

Make sure you have read the HOW TO POST thread
teovilo
CodeLite Curious
Posts: 2
Joined: Fri Dec 01, 2023 4:29 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How do I create a C-only project?

Post by teovilo »

Thanks for the reply eranif. I tried your solution and it has the same behaviour. G++ is still invoked during the linking stage. For a C-only project, it should be handled by GCC only. Furthermore, adding a new file to the templated project still defaults to *.cpp. This is not a user friendly way to use Codelite as a C IDE.

Is there a way to use Codelite with first-class support for C without treating as a subset of C++? Can I create my own Workspace template?

Post Reply