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

在使用线程时,使用gcc或arm linux gcc编译时,会出现错误:undefined reference to pthread create 主要是以下两种原因: include lt pthread.h gt 请确认头文件是否添加 lpthread 编译选项,即在编译时需添加额外的编译选项,如使用arm linux gcc编译lc led test.c文件,命令正确应该如下: arm li ...

2014-12-08 12:03 0 3791 推荐指数:

查看详情

undefined reference to `pthread_create'

问题描述: ubuntu 16.04 下 C语言开发环境, 已经添加了头文件#include <pthread.h> 以及在Makefile中添加了 -lpthread,但是编译时仍然报错: undefined reference to `pthread_create ...

Fri Feb 22 18:50:00 CST 2019 0 911
Linuxundefined reference to ‘pthread_create’问题解决

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

Tue Aug 15 19:09:00 CST 2017 0 35587
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM