找不到-lpthread? [英] Cannot find -lpthread?

查看:1357
本文介绍了找不到-lpthread?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试使用pthread API编写一些并发程序。


$ b $我下载了eclipse IDE for C / C ++ Developers,MinGW。我把所有的库,头文件放到MinGW文件的相应位置。



当我尝试构建项目时总是有一个错误找不到 - lpthread,怎么了?
我已将-pthread添加到GCC编译器。



我在Google中搜索了很多,但似乎没有人像我这样有类似的问题。 / p>

解决方案

这个问题的人谁也缺少MinGW pthread库应该帮助你!本质上,MinGW安装程序脚本在安装时可能无法下载lpthread库。引用链接:


只需运行并打开MinGW Installation Manager,该管理器应与MinGW一起预先安装,选择左侧面板,右侧面板上搜索mingw32-pthreads-w32软件包并进行安装。



I am new to C programming.

I was trying to use the pthread API to write some concurrent program.

I downloaded eclipse IDE for C/C++ Developers, MinGW. I have put all the library, header files into the corresponding location of the MinGW file.

When I tried to build the project, there is always an error "cannot find -lpthread", what happened? I have added the "-pthread" to the GCC compiler.

I have searched a lot in Google but seems no one have similar problem as me.

解决方案

The answer to this question by someone who is also missing MinGW pthread library should help you out! Essentially the issue is that the MinGW installer script might not download the lpthread library upon installation. Quoted from link:

Just run and open MinGW Installation Manager, which should be pre-installed with MinGW, select "All Packages" on the left panel, and on the right panel, search for "mingw32-pthreads-w32" packages and install them.

这篇关于找不到-lpthread?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆