libvpx: пример компиляции простого кодировщика

Я пытаюсь скомпилировать пример кодировщика 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), так что все должно быть на месте. Кто-нибудь еще сталкивался с этой проблемой?


person Arizel    schedule 02.06.2013    source источник


Ответы (2)


Вам не хватает ссылки на математическую библиотеку, -lm

person berkus    schedule 11.11.2013

Вы связываетесь с libvpx статически? Вы можете просто использовать -lvpx для динамической ссылки. Я не сталкивался с этой проблемой (ubuntu 12.10, x64, vpx, собранный из исходников, gcc 4.7.2).

В любом случае pow, exp, sqrt и т. д. являются частью libm, математической библиотеки, поставляемой с компилятором, поэтому просто добавьте -lm к своим флагам компоновщика, и эти ошибки должны исчезнуть.

person ferry    schedule 27.06.2013