【问题标题】:pkg-config cant find libraries on ffmpeg build (linux)pkg-config 在 ffmpeg 构建(linux)上找不到库
【发布时间】:2018-11-12 18:07:30
【问题描述】:

我正在尝试在 ubuntu 上为 android 构建 ffmpeg...

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

但是./configure 一直在说

ERROR: librtmp not found using pkg-config

我已经测试过,如果我删除--enable-librtmp,它将配置抱怨其他库。问题是我自己构建了所有库。所以我确定它存在并且位于正确的文件夹中。

我不是 linux/编译器专家,到目前为止,我已经花费了 10 多天的时间来正确完成这个项目所需的一切。我知道我可以简单地修改 ffmpeg 下的配置文件并删除 pkg-config 检查,但这不是我正在寻找的解决方案

我运行的命令是:

./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

我想知道 pkg-config 执行哪些测试来检测是否安装了任何库?以及如何向它展示我需要的库确实存在

=========更新=========

${PREFIX} 代表build_dir,在该文件夹下我有一个文件夹lib/pkgconfig,其中包含许多.pc 文件,包括librtmp.pc。那么为什么它可以检测到其他但不能检测到这个呢?我检查了文件的内容和接缝是否正确,类似于同一文件夹中的其他人

【问题讨论】:

    标签: android linux ffmpeg cross-compiling pkg-config


    【解决方案1】:

    在执行 ./configure 之前尝试此命令

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

    我在安装 libx265 时遇到了类似的问题。

    【讨论】:

    • 非常感谢!我是这些东西的新手,这很有帮助
    猜你喜欢
    • 1970-01-01
    • 2019-01-25
    • 2013-02-13
    • 2022-06-26
    • 1970-01-01
    • 2018-10-06
    • 2014-06-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多