【问题标题】:libvpx: Compiling simple encoder examplelibvpx:编译简单的编码器示例
【发布时间】:2013-11-12 01:15:47
【问题描述】:

我正在尝试编译 Google 的 libvpx 编码器示例,可以在这里找到:

http://www.webmproject.org/docs/vp8-sdk/example__simple__encoder.html

不幸的是 libvpx 似乎缺少依赖项:

/usr/local/lib/libvpx.a(rdopt.c.o): In function `vp8_initialize_rd_consts':
(.text+0x3519): undefined reference to `pow'
/usr/local/lib/libvpx.a(onyx_if.c.o): In function `vp8_create_compressor':
(.text+0x34a8): undefined reference to `log'
/usr/local/lib/libvpx.a(psnr.c.o): In function `vp8_mse2psnr':
(.text+0x1f): undefined reference to `log10'
/usr/local/lib/libvpx.a(postproc.c.o):(.text+0xa4): undefined reference to `exp'
/usr/local/lib/libvpx.a(postproc.c.o): In function `vp8_gaussian':
(.text+0x11d2): undefined reference to `exp'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0x539): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0x5b6): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0x8cb): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0xb52): undefined reference to `sqrt'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0xca3): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_init_second_pass':
(.text+0x22b2): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_init_second_pass':
(.text+0x2376): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x26c6): undefined reference to `log'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x26df): undefined reference to `log'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x26f6): undefined reference to `log'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x2f39): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x300e): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x3790): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x387d): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x3c6d): undefined reference to `pow'
/usr/local/lib/libvpx.a(firstpass.c.o):(.text+0x486f): more undefined references to `pow' follow
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x7208): undefined reference to `sqrt'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x7264): undefined reference to `sqrt'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x72b8): undefined reference to `sqrt'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x7330): undefined reference to `sqrt'
/usr/local/lib/libvpx.a(firstpass.c.o): In function `vp8_second_pass':
(.text+0x73c1): undefined reference to `sqrt'

我使用的是 Fedora 18 x64 并且已经从源代码构建了 libvpx(make + make install),所以一切都应该到位。还有其他人遇到过这个问题吗?

【问题讨论】:

    标签: vp8 libvpx


    【解决方案1】:

    您是否与 libvpx 静态链接?您可以只使用 -lvpx 动态链接。我没有遇到这个问题(ubuntu 12.10, x64, vpx built from sources, gcc 4.7.2)。

    无论如何,pow、exp、sqrt 等都是 libm(编译器附带的数学库)的一部分,因此只需将 -lm 添加到链接器标志中,这些错误就会消失。

    【讨论】:

      【解决方案2】:

      你缺少链接数学库,-lm

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-07-26
        • 2017-08-16
        • 2012-09-10
        • 1970-01-01
        • 2012-06-15
        • 2017-03-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多