編譯 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…
因此需要將庫鏈接放在末尾。