【问题标题】:gcc error- "error adding symbols: DSO missing from command line"gcc 错误-“添加符号时出错:命令行中缺少 DSO”
【发布时间】:2015-11-02 08:59:05
【问题描述】:

我正在尝试从enter link description herehttp://dranger.com/ffmpeg/tutorial01.html 编译教程 01 从这里复制粘贴代码:http://dranger.com/ffmpeg/tutorial01.c 尝试编译(在 linux 上),就像教程说的那样:

gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lswscale -lz

得到一个错误

: /usr/bin/ld: /tmp/ccIT5t82.o: undefined reference to symbol 'av_malloc@@LIBAVUTIL_51'
/usr/lib/i386-linux-gnu/libavutil.so.51: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

有什么建议吗?

【问题讨论】:

    标签: linux gcc ffmpeg


    【解决方案1】:

    您忘记链接avutil库,请在编译代码时添加-lavutil。

    gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lswscale -lz -lavutil
    

    【讨论】:

    • 添加,现在有:/tmp/ccIskNE0.o: 在函数main': tutorial1.c:(.text+0x501): undefined reference to avcodec_free_frame' tutorial1.c:(.text+0x50d): undefined reference to `avcodec_free_frame' collect2: error: ld返回 1 个退出状态
    猜你喜欢
    • 1970-01-01
    • 2015-09-18
    • 1970-01-01
    • 2013-11-22
    • 2018-02-12
    • 2017-05-13
    • 2020-01-12
    • 1970-01-01
    • 2021-10-07
    相关资源
    最近更新 更多