我在 Code::Blocks 中遇到问题,尝试构建 C++ 代码会导致错误消息“错误:id 返回 5 退出状态”,即使代码中不存在语法错误也是如此。这是一个例子:
#include <iostream>
int main() {
std::cout<<"hello world";
}
即使对于这个简单的代码片段,也会发生同样的错误。完整的“重建全部”日志在这里
-------------- Clean: Release in GraphicsC++ (compiler: GNU GCC
Compiler)---------------
Cleaned "GraphicsC++ - Release"
-------------- Build: Release in GraphicsC++ (compiler: GNU GCC
Compiler)---------------
g++.exe -Wall --verbose -fexceptions -O2 -Iinclude -c
C:\Users\ALEX\Documents\GraphicsC++\main.cpp -o obj\Release\main.o
g++.exe -o bin\Release\GraphicsC++.exe obj\Release\main.o --verbose -
s ..\..\..\..\Windows\SysWOW64\glu32.dll
Using built-in specs.
COLLECT_GCC=g++.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-
mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --
prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-
rev0/mingw64 --enable-shared --enable-static --disable-multilib --
enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --
enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto -
-enable-graphite --enable-checking=release --enable-fully-dynamic-
string --enable-version-specific-runtime-libs --disable-libstdcxx-pch -
-disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-
win32-registry --disable-nls --disable-werror --disable-symvers --with-
gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-
libiconv --with-system-zlib --with-
gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-
mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-
mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-
isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-
pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-
bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -
fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-
rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-
static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-
static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-
810-posix-seh-rt_v6-rev0/mingw64/opt/include -
I/c/mingw810/prerequisites/x86_64-zlib-static/include -
I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include'
CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-
rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-
static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-
static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-
posix-seh-rt_v6-rev0/mingw64/opt/lib -
L/c/mingw810/prerequisites/x86_64-zlib-static/lib -
L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
COLLECT_GCC_OPTIONS='-Wall' '-v' '-fexceptions' '-O2' '-I' 'include' '-
c' '-o' 'obj\Release\main.o' '-shared-libgcc' '-mtune=core2' '-
march=nocona'
C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64-
mingw32/8.1.0/cc1plus.exe -quiet -v -I include -iprefix C:/Program
Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/ -
D_REENTRANT C:\Users\ALEX\Documents\GraphicsC++\main.cpp -quiet -
dumpbase main.cpp -mtune=core2 -march=nocona -auxbase-strip
obj\Release\main.o -O2 -Wall -version -fexceptions -o
C:\Users\ALEX\AppData\Local\Temp\ccF1iSDG.s
GNU C++14 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) version
8.1.0 (x86_64-w64-mingw32)
compiled by GNU C version 8.1.0, GMP version 6.1.2, MPFR version 4.0.1,
MPC version 1.1.0, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min- heapsize=131072
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64- mingw32/8.1.0/include/c++"
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64- mingw32/8.1.0/include/c++/x86_64-w64-mingw32"
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64- mingw32/8.1.0/include/c++/backward"
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64- mingw32/8.1.0/include"
ignoring nonexistent directory "C:/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../include"
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed"
ignoring duplicate directory "C:/Program Files/CodeBlocks/MinGW/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "C:/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
include
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include
cc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64End of search list.
GNU C++14 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) version 8.1.0 (x86_64-w64-mingw32)
compiled by GNU C version 8.1.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 82f0c9785fd37a38ba7b7f8357369a82
COLLECT_GCC_OPTIONS='-Wall' '-v' '-fexceptions' '-O2' '-I' 'include' '-c' '-o' 'obj\Release\main.o' '-shared-libgcc' '-mtune=core2' '-march=nocona'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64- mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -I include -o obj\Release\main.o C:\Users\ALEX\AppData\Local\Temp\ccF1iSDG.s
GNU assembler version 2.30 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.30
COMPILER_PATH=C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64- mingw32/8.1.0/;C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64- mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64- mingw32/8.1.0/../../../../lib/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../
COLLECT_GCC_OPTIONS='-Wall' '-v' '-fexceptions' '-O2' '-I' 'include' '-c' '-o' 'obj\Release\main.o' '-shared-libgcc' '-mtune=core2' '- march=nocona'
Using built-in specs.
COLLECT_GCC=g++.exe
COLLECT_LTO_WRAPPER=C:/Program\ Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto- wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 -- prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6- rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable- languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable- threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable- graphite --enable-checking=release --enable-fully-dynamic-string --enable- version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx- debug --enable-bootstrap --disable-rpath --disable-win32-registry -- disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib -- with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with- mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with- mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with- isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with- pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with- bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno- ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include - I/c/mingw810/prerequisites/x86_64-zlib-static/include - I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6- rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib- static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32- static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6- rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib- static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32- static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix- seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib- static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc 版本 8.1.0(x86_64-posix-seh-rev0,由 MinGW-W64 项目构建) COMPILER_PATH=C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/;C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc /;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin / LIBRARY_PATH=C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc /;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib /../lib/;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../lib/ ;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/ ;C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../ COLLECT_GCC_OPTIONS='-o' 'bin\Release\GraphicsC++.exe' '-v' '-s' '-shared-libgcc' '-mtune=core2' '-march=nocona' C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/collect2.exe -plugin C:/Program Files/CodeBlocks/MinGW/bin/../libexec /gcc/x86_64-w64-mingw32/8.1.0/liblto_plugin-0.dll -plugin-opt=C:/Program Files/CodeBlocks/MinGW/bin/../libexec/gcc/x86_64-w64-mingw32/8.1。 0/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\ALEX\AppData\Local\Tem