FFMPEG与VPX库链接

时间:2016-08-20 19:55:12

标签: c++ ffmpeg g++

我想编译我正在编写的代码以使用ffmpeg,但我无法链接此代码。我添加了所有必需的库,但仍无法正常工作

g++ -L/home/user/ffmpeg_build/lib -o "vpx" ./src/vpx.o -lpthread -lavcodec -lavutil -lvpx /home/user/ffmpeg_build/lib/libavcodec.a(frame_thread_encoder.o): In function ff_frame_thread_encoder_init&#39 ;: /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/frame_thread_encoder.c:213:未定义引用pthread_create' /home/user/ffmpeg_build/lib/libavcodec.a(frame_thread_encoder.o): In function ff_frame_thread_encoder_free': makefile:45:目标配方' vpx'失败 /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/frame_thread_encoder.c:238:对pthread_join' /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/frame_thread_encoder.c:238: undefined reference to pthread_join'的未定义引用 /home/user/ffmpeg_build/lib/libavcodec.a(pthread_frame.o):在函数ff_frame_thread_free': /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/pthread_frame.c:564: undefined reference to pthread_join' /home/user/ffmpeg_build/lib/libavcodec.a(pthread_frame.o):在函数ff_frame_thread_init': /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/pthread_frame.c:704: undefined reference to pthread_create' /home/user/ffmpeg_build/lib/libavcodec.a(pthread_slice.o):在函数ff_slice_thread_free': /home/user/ffmpeg_sources/ffmpeg-3.1.2/libavcodec/pthread_slice.c:116: undefined reference to pthread_join'`

1 个答案:

答案 0 :(得分:0)

pthread必须是最后一个要链接的库