編譯 uvc_streamer報錯

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

發佈了55 篇原創文章 · 獲贊 22 · 訪問量 24萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章