Force Codelite to use GCC.exe only

General questions regarding the usage of CodeLite
flexmcmurphy
CodeLite Curious
Posts: 7
Joined: Sun Jul 26, 2020 12:01 am
Genuine User: Yes
IDE Question: C++
Contact:

Force Codelite to use GCC.exe only

Post by flexmcmurphy »

Hello,

I have just started using Codelite and still learning about it and programming in general.

I am using Codelite to work through a C programming textbook. I create a new project for each C program. I configured Codelite to use GCC 10.2.0

When I hit F7 to build a project I get this kind of output...

Code: Select all

C:\Windows\system32\cmd.exe /C ""D:/Application Data/mingw64/bin/mingw32-make.exe" -j8 SHELL=cmd.exe -e -f  Makefile"
"----------Building project:[ KnK-Chapter2-E1 - Debug ]----------"
mingw32-make[1]: Entering directory 'D:/Computing/C-Programming/KnK-C-Programs/KnK-Chapter2/KnK-Chapter2-E1'
"D:/Application Data/mingw64/bin/gcc.exe" -c  "D:/Computing/C-Programming/KnK-C-Programs/KnK-Chapter2/KnK-Chapter2-E1/KandR.c" -g -O0 -Wall -pedantic -Wextra -std=c99 -o Debug/KandR.c.o -I. -I.
"D:/Application Data/mingw64/bin/g++.exe" -o Debug/KnK-Chapter2-E1 @"KnK-Chapter2-E1.txt" -L.
mingw32-make[1]: Leaving directory 'D:/Computing/C-Programming/KnK-C-Programs/KnK-Chapter2/KnK-Chapter2-E1'
====0 errors, 0 warnings====
It looks like Codelite is using gcc.exe in one step but then g++.exe in another step. All my programs are going to be in the C language. How can I make it only use gcc.exe?

Does the default makefile have to be changed? If so, could someone please give a step by step on how to change the default makefile or how to create a new one? In my scenario I will probably always be compiling just one source file.. for now at least.

Because of the above output do I have to set the same compiler parameters for both the C and C++ compilers in the current active project settings?

Cheers,

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

Re: Force Codelite to use GCC.exe only

Post by eranif »

The "other" step is "linking"
To change this:

Settings -> Build Settings -> Compiler, and choose your compiler from the list on the left

Next, select the tab "Tools" (the first one) change the "Linker' from g++ -> gcc
Make sure you have read the HOW TO POST thread
flexmcmurphy
CodeLite Curious
Posts: 7
Joined: Sun Jul 26, 2020 12:01 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Force Codelite to use GCC.exe only

Post by flexmcmurphy »

That did it, thanks Eran!
Post Reply