简体   繁体   English

制作:g++:错误:CreateProcess:没有那个文件或目录

[英]make: g++: error: CreateProcess: No such file or directory

I see that this issue has been posted many many times but none of solutions worked for me and my problem is a bit different.我看到这个问题已经发布了很多次,但没有一个解决方案对我有用,我的问题有点不同。

The problem:问题:

When a use a makefile and mingw32-make, I get the error:当使用 makefile 和 mingw32-make 时,出现错误:

g++: error: CreateProcess: No such file or directory

However, if I copy/paste the SAME command that the makefile tried to do and paste it in the SAME command prompt it works.但是,如果我复制/粘贴 makefile 尝试执行的 SAME 命令并将其粘贴到 SAME 命令提示符中,则它可以工作。 This problem only occurs when I try to build with a makefile.仅当我尝试使用 makefile 构建时才会出现此问题。

Here's more info:以下是更多信息:

g++ ./src/main.cpp ./src/application.cpp -I C:\Code\infographie\Labs\inc -L    C:\Code\infographie\Labs\lib -I C:\Code\infographie\Labs\inc -g -Dmain=SDL_main -L C:\Code\infographie\Labs\lib -lmingw32 -lSDL2main -lSDL2 -o  bin/debug/labs.exe
g++: error: CreateProcess: No such file or directory
makefile:23: recipe for target 'all' failed
mingw32-make: *** [all] Error 1

As I said, If I copy/paste the first line it will work.正如我所说,如果我复制/粘贴第一行,它将起作用。

What can I try?我可以尝试什么?

UPDATE: I've installed cygwin, adjusted SDL libs and recompiled.更新:我已经安装了 cygwin,调整了 SDL 库并重新编译。 Now I get this error when I try to use make.现在,当我尝试使用 make 时出现此错误。 If I copy/paste the command, it works.如果我复制/粘贴命令,它就可以工作。

g++ ./src/main.cpp ./src/application.cpp -I C:\Code\infographie\Labs\inc -L   C:\Code\infographie\Labs\lib -I C:\Code\infographie\Labs\inc -g -Dmain=SDL_main -L C:\Code\infographie\Labs\lib -lcygwin -lSDL2main -lSDL2 -  mwindows -o bin/debug/labs.exe
make: g++: Command not found
make: *** [makefile:23: all] Error 127

FIXED IT, don't declare a variable named PATH...已修复,不要声明名为 PATH 的变量...

Stop using MinGW.停止使用 MinGW。

MinGW has not been updated since 2013 . MinGW自 2013 年以来未更新。 It has been replaced by Cygwin and MSYS2.它已被 Cygwin 和 MSYS2 取代。 The MinGW project doesn't even offer a 64-bit compiler . MinGW 项目甚至不提供64 位编译器

Cygwin can be installed in about 3 minutes , I would give it a try. Cygwin 可以在大约3 分钟内安装,我会尝试一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 g ++:错误:CreateProcess没有这样的文件或目录 - g++: error: CreateProcess no such file or directory g ++ CreateProcess:没有这样的文件或目录 - g++ CreateProcess: no such file or directory g++:致命错误:无法执行“as”:CreateProcess:没有这样的文件或目录编译终止 - g++: fatal error: cannot execute 'as': CreateProcess: No such file or directory compilation terminated g++: CreateProcess: 没有这样的文件或目录。 找不到解决办法 - g++: CreateProcess: No such file or directory. Can't find solution g ++错误没有这样的文件或目录 - g++ error no such file or directory make error:“g ++:error:main.o:没有这样的文件或目录” - make error: “g++: error: main.o: No such file or directory” g++:无法执行'DIRECTORY/collect2.exe':CreateProcess:没有这样的文件或目录 - g++ :cannot execute ‘DIRECTORY/collect2.exe’:CreateProcess: No such file or directory g ++ makefile,包含错误,没有这样的文件或目录 - g++ makefile, include error, no such file or directory g++:错误:<descriptive name> : 没有这样的文件或目录</descriptive> - g++: error: <descriptive name>: No such file or directory vscode中的g++错误:没有这样的文件或目录 - g++ error in vscode: no such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM