编译 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…
因此需要将库链接放在末尾。