【发布时间】:2021-10-10 23:00:52
【问题描述】:
尽管我进行了多次搜索,但我在这里找到了很多已回答的问题,但绝对没有一个能解决我的问题。我一直在使用gcc 来编译我的C 代码,并且运行良好。我决定开始使用C++。我尝试编译它并没有工作:
PS D:\huntr> gcc ./test.cpp -o ./test.exe
gcc.exe: error: CreateProcess: No such file or directory
我尝试向路径添加东西,从路径中删除东西,一切。不管我做什么,它总是给我这个错误。这是启用-v 的输出:
PS D:\huntr> gcc ./test.cpp -o ./test.exe -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
COLLECT_GCC_OPTIONS='-o' './test.exe' '-v' '-mtune=generic' '-march=i586'
cc1plus -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/6.3.0/ ./test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=i586 -auxbase test -version -o C:\Users\FOXROC~1\AppData\Local\Temp\cc44oQcd.s
gcc.exe: error: CreateProcess: No such file or directory
我该怎么办??
【问题讨论】:
-
GCC 6.3.0 真的太旧了,考虑切换到更新的 MinGW-w64 版本,比如可以通过 MSYS2 的包管理器下载的版本或从winlibs.com 独立构建的版本