原文:问题:eclipse中线程编程编译报错,undefined reference to 'pthread_create'的解决方法(已解决)

问题描述: 在Ubuntu系统中,使用eclipse CDT集成开发环境编写pthread程序,编译时,pthread create不通过,报错信息是: undefined reference to pthread create 的解决方法 解决方法: 这个报错的原因是Linux系统并没有把pthread.h文件作为默认编程库,在gcc中编程需要加参数,命令行中执行如下: 需要加参数 lpthre ...

2018-11-02 14:06 0 801 推荐指数:

查看详情

(笔记)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
Linux下undefined reference to ‘pthread_create问题解决

Linux下undefined reference to ‘pthread_create问题解决 在试用Linux 线程模块时,试用pthread_create 函数。 编译命令为 gcc main.c -o test时,会出现如下错误 问题的原因:pthread不是linux下的默认 ...

Tue Aug 15 19:09:00 CST 2017 0 35587
Linux下undefined reference to ‘pthread_create问题解决 zz

接触了Linux系统编程中的线程编程模块,可gcc sample.c(习惯把书上的sample代码写进sample.c文件中)出现“undefined reference to ‘pthread_create’”,所有关于线程的函数都会有此错误,导致无法编译通过。 问题的原因:pthread ...

Thu Jan 25 22:14:00 CST 2018 0 1484
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM