Page 1 of 1

Force Codelite to use GCC.exe only

Posted: Fri Jul 31, 2020 1:51 am
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

Re: Force Codelite to use GCC.exe only

Posted: Sat Aug 01, 2020 9:19 am
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

Re: Force Codelite to use GCC.exe only

Posted: Sat Aug 01, 2020 4:38 pm
by flexmcmurphy
That did it, thanks Eran!