【发布时间】:2023-02-04 19:49:56
【问题描述】:
我有一个简单的 main.c 文件,它只打印 hello world,然后我得到了 premake5.lua。
workspace "HelloWorld"
configurations { "Debug", "Release" }
project "HelloWorld"
kind "ConsoleApp"
language "C"
targetdir "bin/%{cfg.buildcfg}"
files {"main.c"}
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
然后我运行 premake5 gmake2 并且运行完美,但是当我尝试运行 make(或 mingw32-make)时它给了我这个错误。
process_begin: CreateProcess(NULL, cc -MD -MP -DDEBUG -g -o obj/Debug/main.o -MF obj/Debug/main.d -c main.c, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [HelloWorld.make:129: obj/Debug/main.o] Error 2
为了使这更有趣,bin 文件夹中没有 .d 文件:(
我期待一个使用 premake5 的简单 hello world 程序,并按照文档中提供的确切步骤进行操作......
【问题讨论】:
-
我记得
mingw32-make有问题。来自 MSYS2 的普通make效果更好。 -
试试
make CC=gcc。