提问人:BrooklynBoy 提问时间:3/10/2023 最后编辑:BrooklynBoy 更新时间:7/1/2023 访问量:185
CodeLite 构建简单主要问题
CodeLite building simple main issue
问:
所以我用新的 g++ 编译器安装了 MSYS2。使用新编译器更新 CodeLite 属性,并尝试仅使用 main(){return 0;} 构建 simpla 应用程序
获取控制台输出中的下一个错误:控制台输出错误
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) ===
当我尝试使用 g++ 命令在终端中构建相同的程序时,一切正常,程序成功构建。
有人可以建议出了什么问题吗?
尝试使用CodeLite和g ++编译简单的程序(g++.exe(Rev10,由MSYS2项目构建)12.2.0)
答:
1赞
BrooklynBoy
3/13/2023
#1
所以,我已经为此奋斗了很长时间:
转到设置。 单击“环境变量”。 将打开一个默认设置的窗口。只需添加行“ SHELL = cmd.exe ”
解决方法是将 SHELL=cmd.exe 添加到 CodeLite 中的环境变量。
评论
$(info SHELL=$(SHELL))