原文:Linux+CLion+树莓派远程编译时,Cmake编译出现undefined reference to 'pthread_create'的解决办法

在CLion中开发讯飞的linux语音库时编译出现以下问题: CLion的cmake配置:修改CMakeLists.txt 该行代码等价于GCC编译命令中的 pthread 参考:https: www.cnblogs.com jiu p .html ...

2019-09-19 14:37 0 1053 推荐指数:

查看详情

(笔记)Linux线程编译undefined reference to 'pthread_create'

在使用线程,使用gcc或arm-linux-gcc编译,会出现错误:undefined reference to 'pthread_create' 主要是以下两种原因: 1、#include <pthread.h> 请确认头文件是否添加 2、-lpthread ...

Mon Dec 08 20:03:00 CST 2014 0 3791
CMake时报undefined reference to `pthread_create'错误

今天自己用CMake搭建一个项目,其中用到了多线程 在make的时候报了 undefined reference to `pthread_create'这个错误,网上很多都是说lpthread 不是linux下默认的库之类的。 只需要在编译的时候加上-lpthread参数。虽然可以解决 ...

Tue Aug 11 18:30:00 CST 2020 0 673
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM