Can't build project in windows 10

CodeLite installation/troubleshooting forum
Homo Banana
CodeLite Curious
Posts: 1
Joined: Tue Jun 21, 2022 11:27 am
Genuine User: Yes
IDE Question: C++
Contact:

Can't build project in windows 10

Post by Homo Banana »

Hello, I'm using CodeLite 16.0.0 under windows 10. It's Installer version.
Create a C hello world project, using mingw64 10.0 as compiler and CodeLite Makefile Generator, leave everything default then press Build Project, this will appear in the build window:

Code: Select all

C:/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ test - Debug ]----------"
mingw32-make[1]: Entering directory 'D:/C_dev/test'
/usr/bin/sh: -c: line 2: syntax error: unexpected end of file
/usr/bin/sh: -c: line 2: syntax error: unexpected end of file
mingw32-make[1]: *** [test.mk:90: ../build-Debug/test/.d] Error 258
mingw32-make[1]: *** Waiting for unfinished jobs....
mingw32-make[1]: *** [test.mk:86: MakeIntermediateDirs] Error 258
<built-in>: fatal error: opening dependency file ../build-Debug/test/main.c.o.d: No such file or directory
compilation terminated.
mingw32-make[1]: *** [test.mk:101: ../build-Debug/test/main.c.o.d] Error 1
mingw32-make[1]: Leaving directory 'D:/C_dev/test'
mingw32-make: *** [Makefile:5: All] Error 2
=== build completed successfully (0 errors, 0 warnings) ===

The build will fail while saying completed.
However, if I use Build Workspace or Compile Current File or Compile Current File's Project, the hello world project can be built as expected:

Code: Select all

C:/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  "test.mk"  MakeIntermediateDirs && C:/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  "test.mk"  all
----------Building project:[ test - Debug ]----------
C:/mingw64/bin/gcc.exe -c  "D:/C_dev/test/main.c" -g -O0 -Wall  -o ../build-Debug/test/main.c.o -I. -I.
C:/mingw64/bin/g++.exe -o ..\build-Debug\bin\test.exe @../build-Debug/test/ObjectsList.txt -L.
=== build completed successfully (0 errors, 0 warnings) ===

Basically, I suppose "Build Project" and "Build Workspace" should be identical in this case, but it turns out "Build Project" will fail on my computer, and unfortunately I know nothing about make and I can't figure out why.
About 2 years ago, I could use CodeLite for similar C/C++ projects with no problem without any twicking. This problem was found recently, by which time I was using the same version of CodeLite (14.0) as I used to use, because too many things can happen in 2 years, I can't tell which event caused my CodeLite unusable. I tried reinstalling CodeLite and reinstalling mingw, didn't work.
Thank you.

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

Re: Can't build project in windows 10

Post by eranif »

please follow the docs on how to properly set up compiler on windows:

install compiler the right way (follow the instructions to the letter):
https://docs.codelite.org/build/mingw_b ... nvironment

once this is done, visit:
settings -> build settings

click on the magnifier button and let CodeLite pick your installation

Change the compiler in your project to the one you just installed

Build your code

Make sure you have read the HOW TO POST thread
Post Reply