pkg-config cant find libraries on ffmpeg build (linux)

余生颓废 提交于 2019-12-24 17:51:31

问题


I'm trying to build ffmpeg for android on ubuntu...

-I've cross-compiled all the dependencies I need for my configuration
-I've set up the configuration parameters

but ./configure keep saying

ERROR: librtmp not found using pkg-config

I've tested and if I remove --enable-librtmp it will configure complain about other library. The thing is I i build all libs myself. So I'm sure it is present and at right folder.

I'm not linux/compiler specialist and so far i've spend more than 10 days to get everything i need to this project rightly done. I know i can simple modify the configure file under ffmpeg and remove the pkg-config check but this isn't the solution I'm looking for

the command i run is:

./configure --prefix=$PREFIX \
  --arch=${ARCH}\
    --cpu=${CPU} \
    --cross-prefix=$CROSS_PREFIX \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --target-os=linux \
    --sysinclude=$NDK/sysroot/usr/include \
    --pkg-config=$(which pkg-config) \
    --pkg-config-flags="--static" \
    --enable-pic \
    --enable-gpl \
    --enable-nonfree \
    \
    --disable-shared \
    --enable-static \
    \
    --enable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    \
    --enable-librtmp \
    --enable-zlib \
    --enable-mediacodec \
    --enable-libx264 \
    --enable-libfdk-aac\
    --enable-libfreetype\
    --enable-libmp3lame\
    --enable-openssl\
    --enable-libfontconfig\
    --enable-bsf=aac_adtstoasc \
    \
    --disable-doc \
    $ADDITIONAL_CONFIGURE_FLAG

I would like to know which tests pkg-config do to detect if any lib is installed? and how can i show it the libs i need are really present

=========UPDATE=========

${PREFIX} stands for build_dir under which i've a folder lib/pkgconfig with many .pc files including librtmp.pc. so why it can detect the others but not this one? i checked the content of the file and seams to be right, similar to others at same folder


回答1:


try this command before do ./configure

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

I met similar problem when I installed libx265.



来源:https://stackoverflow.com/questions/50663067/pkg-config-cant-find-libraries-on-ffmpeg-build-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!