【问题标题】:Compiling libsndfile, and it does not find FLAC编译libsndfile,找不到FLAC
【发布时间】:2016-12-12 11:25:14
【问题描述】:

我正在尝试交叉编译 libsndfile 以在具有 flac 功能的英特尔爱迪生上使用。我已经成功地将 FLAC、OGG 和 VORBIS 编译到我的交叉工具链中,但是当我运行 ./configure 时,它给了我以下输出:

checking for pkg-config... /opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for flac >= 1.3.1 ... no
checking for ogg >= 1.1.3 ... yes
checking for vorbis >= 1.2.3 ... yes
checking for vorbisenc >= 1.2.3 ... yes

configure: WARNING: *** One or more of the external libraries (ie libflac, libogg and
configure: WARNING: *** libvorbis) is either missing (possibly only the development
configure: WARNING: *** headers) or is of an unsupported version.
configure: WARNING: ***
configure: WARNING: *** Unfortunately, for ease of maintenance, the external libs
configure: WARNING: *** are an all or nothing affair.

我的环境变量是这样设置的:

export SDKTARGETSYSROOT=/opt/poky-edison/1.7.3/sysroots/core2-32-poky-linux
export PATH=/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin:/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin/i586-poky-linux:$PATH
export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig
export CONFIG_SITE=/opt/poky-edison/1.7.3/site-config-core2-32-poky-linux
export OECORE_NATIVE_SYSROOT="/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux"
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
export OECORE_ACLOCAL_OPTS="-I /opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/share/aclocal"
export PYTHONHOME=/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr
export CC="i586-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT"
export CXX="i586-poky-linux-g++  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT -I${SDKTARGETSYSROOT}/usr/include/c++/4.9.1 -I${SDKTARGETSYSROOT}/usr/include/c++/4.9.1/i586-poky-linux"
export CPP="i586-poky-linux-gcc -E  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT"
export AS="i586-poky-linux-as  "
export LD="i586-poky-linux-ld   --sysroot=$SDKTARGETSYSROOT"
export GDB=i586-poky-linux-gdb
export STRIP=i586-poky-linux-strip
export RANLIB=i586-poky-linux-ranlib
export OBJCOPY=i586-poky-linux-objcopy
export OBJDUMP=i586-poky-linux-objdump
export AR=i586-poky-linux-ar
export NM=i586-poky-linux-nm
export M4=m4
export TARGET_PREFIX=i586-poky-linux-
export CONFIGURE_FLAGS="--target=i586-poky-linux --host=i586-poky-linux --build=i686-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export LDFLAGS=""
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="1.7.3"
export OECORE_SDK_VERSION="1.7.3"
export ARCH=x86
export CROSS_COMPILE=i586-poky-linux-

但是 flac 库在那里(在 /opt/poky-edison/1.7.3/sysroots/core2-32-poky-linux/usr/local 中)!我尝试向我在几个地方编译的 flac 库添加显式路径,但没有任何区别。有没有我应该尝试调整路径的特定位置?

【问题讨论】:

    标签: linux cross-compiling flac intel-edison libsndfile


    【解决方案1】:

    Edison SDK 实际上已经带有 FLAC,但是是一个 版本。将我自己的版本编译到我的 SDK 中的 usr/local/lib 位置并没有更新 pkgConfig,因为它将 pkgconfig 放入 /usr/local/ib/pkgconfig

    最简单的解决方案是将由: 分隔的路径添加到环境设置脚本中的PKG_CONFIG_PATH 变量中。例如,第 4 行变为: export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig:$SDKTARGETSYSROOT/usr/local/lib/pkgconfig

    您也可以在./config 步骤中传递路径,但我认为将其添加到变量中是更好的长期解决方案。

    【讨论】:

      猜你喜欢
      • 2021-07-23
      • 2012-12-05
      • 1970-01-01
      • 1970-01-01
      • 2011-09-18
      • 2020-08-10
      • 2020-03-20
      • 2012-07-19
      • 2012-01-31
      相关资源
      最近更新 更多