gpt4 book ai didi

hyperlink - ffmpeg 链接错误 : undefined reference in library sources

转载 作者:行者123 更新时间:2023-12-04 23:16:22 24 4
gpt4 key购买 nike

我从 git 下载了 ffmpeg,并按来源制作了这些库。如下创建main.c并将ffmpeg库放在与main.c相同的文件夹中,(我的系统是ubuntu 15.10,gcc版本5.2.1)

#include <stdio.h>
void av_register_all(void);
int main() {
printf("abc\n");
av_register_all();
return 0;
}

在我发出 gcc main.c -L. -lavformat -lswscale -lavcodec -lswscale -lavutil -lavdevice -lavfilter 之后,我得到了很多(近 1000 个)未定义的引用错误:
...
/home/arton/sources/ffmpeg/libavcodec/vorbisdec.c:868: undefined reference to `atan'
/home/arton/sources/ffmpeg/libavcodec/vorbisdec.c:868: undefined reference to `atan'
/home/arton/sources/ffmpeg/libavcodec/vorbisdec.c:869: undefined reference to `atan'
/home/arton/sources/ffmpeg/libavcodec/vorbisdec.c:869: undefined reference to `atan'
/home/arton/sources/ffmpeg/libavcodec/vorbisdec.c:869: undefined reference to `floor'
...

/home/arton/sources 是 ffmpeg 的来源,我不知道为什么它报告 ffmpeg 的源路径以及链接失败的原因。任何提示表示赞赏。谢谢!

最佳答案

atanfloor包含在 lm 中.

您是否链接到 lm ?

您可能想阅读 this .

关于hyperlink - ffmpeg 链接错误 : undefined reference in library sources,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35088123/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com