- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我现在花了几个小时来研究网上关于为 iOS 构建 ffmpeg 的少量信息。构建过程似乎运行良好,我最终得到了 armv6 和 armv7 的胖文件,我将它们拖到我的项目中。
但是,每当我尝试使用“avcodec_init()”命令时,都会出现以下错误:
Undefined symbols for architecture armv7: "_avcodec_init", referenced from:
-[FirstViewController viewDidLoad] in FirstViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
export PLATFORM="iPhoneOS" export MIN_VERSION="4.0" export MAX_VERSION="5.1" export DEVROOT=/Volumes/Lion/Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer export SDKROOT=$DEVROOT/SDKs/${PLATFORM}${MAX_VERSION}.sdk export CC=$DEVROOT/usr/bin/llvm-gcc export LD=$DEVROOT/usr/bin/ld export CPP=$DEVROOT/usr/bin/cpp export CXX=$DEVROOT/usr/bin/llvm-g++ export AR=$DEVROOT/usr/bin/ar export LIBTOOL=$DEVROOT/usr/bin/libtool export NM=$DEVROOT/usr/bin/nm export CXXCPP=$DEVROOT/usr/bin/cpp export RANLIB=$DEVROOT/usr/bin/ranlib
COMMONFLAGS="-pipe -gdwarf-2 -no-cpp-precomp -isysroot ${SDKROOT} -marm -fPIC" export LDFLAGS="${COMMONFLAGS} -fPIC" export CFLAGS="${COMMONFLAGS} -fvisibility=hidden" export CXXFLAGS="${COMMONFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden"
FFMPEG_LIBS="libavcodec libavdevice libavformat libavutil libswscale"
echo "Building armv6..."
make clean ./configure \ --cpu=arm1176jzf-s \ --extra-cflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION} -mthumb' \ --extra-ldflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION}' \ --enable-cross-compile \ --arch=arm \ --target-os=darwin \ --cc=${CC} \ --sysroot=${SDKROOT} \ --prefix=installed \ --disable-network \ --disable-decoders \ --disable-muxers \ --disable-demuxers \ --disable-devices \ --disable-parsers \ --disable-encoders \ --disable-protocols \ --disable-filters \ --disable-bsfs \ --enable-decoder=h264 \ --enable-decoder=svq3 \ --enable-gpl \ --enable-pic \ --disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv6 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a ./build.armv6/; done
echo "Building armv7..."
make clean ./configure \ --cpu=cortex-a8 \ --extra-cflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION} -mthumb' \ --extra-ldflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION}' \ --enable-cross-compile \ --arch=arm \ --target-os=darwin \ --cc=${CC} \ --sysroot=${SDKROOT} \ --prefix=installed \ --disable-network \ --disable-decoders \ --disable-muxers \ --disable-demuxers \ --disable-devices \ --disable-parsers \ --disable-encoders \ --disable-protocols \ --disable-filters \ --disable-bsfs \ --enable-decoder=h264 \ --enable-decoder=svq3 \ --enable-gpl \ --enable-pic \ --disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv7 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a ./build.armv7/; done
mkdir -p build.universal for i in ${FFMPEG_LIBS}; do lipo -create ./build.armv7/$i.a ./build.armv6/$i.a -output ./build.universal/$i.a; done
for i in ${FFMPEG_LIBS}; do cp ./build.universal/$i.a ./$i/$i.a; done
make install
最佳答案
我还没有使用过 ffmpeg(尽管我的一些老板让我考虑使用它),但 lemme 提出了一些可能在这里发生的事情。
1)
让我们看看这个符号是否真的存在于你编译的库中。
转到终端和“cd
”到您的 .a 库所在的目录。
然后在一行中输入“nm -arch armv7 ffmpeg.a | egrep avcodec_init
”(您可以在我的示例命令中将 ffmpeg.a
替换为 .a 库的实际名称)。这会为 armv7 架构转储库中的符号并将其通过管道传输到 grep,这应该会显示 avcodec_init 是否确实存在于您的库中。
如果它没有出现,那么它没有被编译到你的库中。
2)
如果该符号确实存在于您的库中,请确保您的 .a 文件的路径在您的项目中是正确的。您可能不小心只包含了一个仅模拟器(i386 架构)版本的 ffmpeg。
关于iphone - iOS 5.1 上的 ffmpeg undefined symbol 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10307804/
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!