簡體   English   中英

制作:g++:錯誤:CreateProcess:沒有那個文件或目錄

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

我看到這個問題已經發布了很多次,但沒有一個解決方案對我有用,我的問題有點不同。

問題:

當使用 makefile 和 mingw32-make 時,出現錯誤:

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

但是,如果我復制/粘貼 makefile 嘗試執行的 SAME 命令並將其粘貼到 SAME 命令提示符中,則它可以工作。 僅當我嘗試使用 makefile 構建時才會出現此問題。

以下是更多信息:

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

正如我所說,如果我復制/粘貼第一行,它將起作用。

我可以嘗試什么?

更新:我已經安裝了 cygwin,調整了 SDL 庫並重新編譯。 現在,當我嘗試使用 make 時出現此錯誤。 如果我復制/粘貼命令,它就可以工作。

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

已修復,不要聲明名為 PATH 的變量...

停止使用 MinGW。

MinGW自 2013 年以來未更新。 它已被 Cygwin 和 MSYS2 取代。 MinGW 項目甚至不提供64 位編譯器

Cygwin 可以在大約3 分鍾內安裝,我會嘗試一下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM