【发布时间】:2014-03-22 19:16:07
【问题描述】:
我在 clear lubuntu 上编译了 ffmpeg,并在 Eclipse 中将库附加到我的项目中时遇到了一堆错误:
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_sbgp':
/root/ffmpeg/libavformat/mov.c:2039: undefined reference to `av_malloc'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_dac3':
/root/ffmpeg/libavformat/mov.c:647: undefined reference to `avpriv_ac3_channel_layout_tab'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_tfhd':
/root/ffmpeg/libavformat/mov.c:2559: undefined reference to `av_log'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stts':
/root/ffmpeg/libavformat/mov.c:1908: undefined reference to `av_malloc'
/root/ffmpeg/libavformat/mov.c:1921: undefined reference to `av_log'
/root/ffmpeg/libavformat/mov.c:1925: undefined reference to `av_log'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stss':
/root/ffmpeg/libavformat/mov.c:1790: undefined reference to `av_malloc'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stsc':
/root/ffmpeg/libavformat/mov.c:1712: undefined reference to `av_malloc'
它只是输出的一部分..somoone 可以帮我处理那个工作人员吗?我卡在这里了,谢谢。
我还给你一些关于 ld --verbose -l avformat 的信息:
attempt to open /usr/i686-linux-gnu/lib32/libavformat.so failed
attempt to open /usr/i686-linux-gnu/lib32/libavformat.a failed
attempt to open /usr/local/lib32/libavformat.so failed
attempt to open /usr/local/lib32/libavformat.a failed
attempt to open /lib32/libavformat.so failed
attempt to open /lib32/libavformat.a failed
attempt to open /usr/lib32/libavformat.so failed
attempt to open /usr/lib32/libavformat.a failed
attempt to open /usr/local/lib/i386-linux-gnu/libavformat.so failed
attempt to open /usr/local/lib/i386-linux-gnu/libavformat.a failed
attempt to open /usr/local/lib/libavformat.so failed
attempt to open /usr/local/lib/libavformat.a succeeded
ld: warning: cannot find entry symbol _start; not setting start address
avutil 的一切都会有问题....所有未定义的引用都来自 libavutil 的文件。但我不知道为什么以及该怎么做。
【问题讨论】:
-
libavutil是ffmpeg的唯一库文件吗?我想它对其他库有额外的依赖。看看this,他用-lavfilter和-lavcodec(还有-lpthread)编译项目。 -
它不会改变任何东西......
-
请提供您传递给编译器的参数。
-
你的意思是编译项目而不是ffmpeg? g++ -L/usr/local/lib/ -o "test" ./src/test.o -lpthread -lavfilter -lavcodec -lavutil -lavformat ./src/test.o:在函数'main'中:
-
见this question。尝试将
-lavutil移动到库列表的末尾。