编译 uvc_streamer报错

本文介绍了解决uvc_streamer编译时遇到的关于pthread_create和pthread_detach未定义引用的问题。通过调整gcc命令行参数及库链接位置,成功解决了编译错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译 uvc_streamer报如下错误:
uvc_stream.o:在函数‘main’中:
uvc_stream.c:(.text.startup+0x4c2):对‘pthread_create’未定义的引用
uvc_stream.c:(.text.startup+0x4ce):对‘pthread_detach’未定义的引用
uvc_stream.c:(.text.startup+0x535):对‘pthread_create’未定义的引用
uvc_stream.c:(.text.startup+0x541):对‘pthread_detach’未定义的引用
uvc_stream.c:(.text.startup+0x5c3):对‘pthread_create’未定义的引用
uvc_stream.c:(.text.startup+0x5cf):对‘pthread_detach’未定义的引用
collect2: error: ld returned 1 exit status
make: * [uga_buga] 错误 1

解决方法
后面man gcc
才知道Usage: gcc [options] file…
因此需要将库链接放在末尾。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值