1

So I have installed MSYS2 with new g++ compiler. Update the CodeLite properties with new compiler and trying to build simpla app with just main(){return 0;}

Getting the next errors in console output: Console output error

C:/msys64/mingw64/bin/mingw32-make.exe -j20 -e -f  Makefile
----------Building project:[ TestingProject - Debug ]----------
mingw32-make[1]: Entering directory 'D:/Work/Workspaces/CodeLite/TestingProject'
C:/msys64/mingw64/bin/g++.exe  -c  "D:/Work/Workspaces/CodeLite/TestingProject/main.cpp" -Wall  -o ../build-Debug/TestingProject/main.cpp.o -I. -I.
/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]: *** [TestingProject.mk:90: ../build-Debug/TestingProject/.d] Error 2
mingw32-make[1]: *** Waiting for unfinished jobs....
mingw32-make[1]: *** [TestingProject.mk:86: MakeIntermediateDirs] Error 2
Assembler messages:
Fatal error: can't create ../build-Debug/TestingProject/main.cpp.o: No such file or directory
mingw32-make[1]: *** [TestingProject.mk:99: ../build-Debug/TestingProject/main.cpp.o] Error 1
mingw32-make[1]: Leaving directory 'D:/Work/Workspaces/CodeLite/TestingProject'
mingw32-make: *** [Makefile:5: All] Error 2
=== build completed successfully (0 errors, 0 warnings) ===

When I try to build the same progrmal in terminal using g++ command everything is okay and the programm succesfully built.

Could someone suggest what is going wrong?

Trying to compile simple program with CodeLite and g++ (g++.exe (Rev10, Built by MSYS2 project) 12.2.0)

  • Welcome to stack overflow -- when asking questions like this, please cut and paste the exact error messages and relevant code into the question as text. Do not add pictures of text or links to pictures of text, as these discourage people from answering your question. – HardcoreHenry Mar 10 '23 at 14:03
  • Okay, sorry, I will correct now – BrooklynBoy Mar 10 '23 at 15:37
  • It looks like you have an issue with what shell make uses to evaluate the recipes... You may want to edit the makefile and add `$(info SHELL=$(SHELL))` to see what shell it's using. You can see [here](https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html) for more info on that. Failing that, try adding the makefile target/recipe that's failing to your question, which might help people help you. – HardcoreHenry Mar 10 '23 at 19:20

1 Answers1

1

So, I have fighting with that for quite long time:

Go to settings. Click on Environment Variables. A window will open with default set. Just Add the line " SHELL = cmd.exe "

The fix is to add SHELL=cmd.exe to environment variables in CodeLite.

Community
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '23 at 02:17
  • This is very strange. `mingw32-make` uses CMD by default, I believe. It's `make` that uses `sh` by default. – HolyBlackCat Jun 30 '23 at 17:13