Empty_Android
Empty_Android
采纳率70.6%
2016-08-27 07:28 浏览 2.4k
已采纳

C++ while 计算1到10的和

错误信息:

 cd 'D:\C++\workspace\CppApplication_2'
D:\C++\MSYS\bin\make.exe -f Makefile CONF=Debug
"/D/C++/MSYS/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/C++/workspace/CppApplication_2'
"/D/C++/MSYS/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_2.exe
make.exe[2]: Entering directory `/d/C++/workspace/CppApplication_2'
mkdir -p build/Debug/MinGW-Windows
rm -f "build/Debug/MinGW-Windows/main.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-Windows
g++     -o dist/Debug/MinGW-Windows/cppapplication_2 build/Debug/MinGW-Windows/main.o 
d:/c++/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/cppapplication_2.exe] Error 1
make.exe[2]: Leaving directory `/d/C++/workspace/CppApplication_2'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/d/C++/workspace/CppApplication_2'
make.exe": *** [.build-impl] Error 2

构建 FAILED (退出值2, 总时间:  556ms)

图片说明
图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答 默认 最新

  • 已采纳
    jiaomenglei 时间杀手Time 2016-08-27 08:09

    要么是g++没有配置好,和代码应该没多大问题

    点赞 3 评论 复制链接分享
  • shihengzhen101 AlbertS 2016-08-27 07:46

    1)你这个问题好像和求和代码没关系啊,貌似环境参数有点问题,你试试打印hello world能不能编译
    2)话说你用的集成开发环境还是自己写的Makefile,怎么看都没看到代码的问题
    3)cannot find -lpthread

    点赞 评论 复制链接分享

相关推荐