使用Qt 5.2.1错误“collect2.exe:Id返回1退出状态”

时间:2014-04-08 14:32:32

标签: c windows qt

当我尝试构建我的应用时,我收到以下错误。任何的想法? 我在Win8上使用Qt 5.2.1和MinGW 4.8 32位

16:14:47: Running steps for project test2...
16:14:47: Configuration unchanged, skipping qmake step.
16:14:47: Starting: "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" 
C:/Qt/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/ha/Desktop/build-test2-Desktop_Qt_5_2_1_MinGW_32bit-Debug'
g++ -Wl,-subsystem,console -mthreads -o debug\test2.exe debug/main.o  
debug/main.o: file not recognized: File truncated
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:77: recipe for target 'debug\test2.exe' failed
mingw32-make[1]: *** [debug\test2.exe] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/ha/Desktop/build-test2-Desktop_Qt_5_2_1_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
16:14:48: The process "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project test2 (kit: Desktop Qt 5.2.1 MinGW 32bit)
When executing step 'Make'
16:14:48: Elapsed time: 00:00.

1 个答案:

答案 0 :(得分:4)

这一行:

debug/main.o: file not recognized: File truncated

告诉您文件main.o未正确创建。从菜单中选择“rebuild”,或删除该文件并再次“构建”。

当您在输出目标文件时中断编译器时,通常会发生这种情况。