Ubuntu 14.04上C / C ++的-pthread和-pthreads之间的区别 [英] Difference between -pthread and -pthreads for C/C++ on Ubuntu 14.04

查看:44
本文介绍了Ubuntu 14.04上C / C ++的-pthread和-pthreads之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在 https://github.com/OpenKinect/libfreenect 上进行编译Ubuntu 14.04 LTS,但是它失败了。在CMake日志上,我看到未找到有关 -pthreads库的错误,但它可以毫无问题地找到 -pthread。两者有什么区别?在Ubuntu上是否有用于-pthreads的特定软件包?

I'm currently trying to compile the https://github.com/OpenKinect/libfreenect on Ubuntu 14.04 LTS but it is failing. On CMake logs, I see errors regarding the "-pthreads" library not being found, but it finds the "-pthread" without problem. What is the difference between both? Is there any specific package for the -pthreads on Ubuntu?

推荐答案

根据GCC手册页, -pthread -pthreads 是特定于体系结构的标志。这些标志并非同时适用于所有拱门。如果两个标志均可用,则它们似乎是彼此的同义词。因此,在没有看到确切的错误输出的情况下,我最好的猜测是您遇到的错误是GCC的 -pthreads 标志不适用于您的arch。

According to the GCC man page, -pthread and -pthreads are architecture-specific flags. These flags are not both available for all archs. Where both flags are available, they appear to be synonyms for each other. So without seeing your exact error output, my best guess is that the error you're running into is that the "-pthreads" flag to GCC is not available for your arch.

我建议您阅读编译器的手册页,以获取有关特定编译器可用选项的更多信息。

I suggest you read the man page for your compiler to get more information about what options are available for your particular build of your compiler.

这篇关于Ubuntu 14.04上C / C ++的-pthread和-pthreads之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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