尝试为 iPhone 编译 x264 和 ffmpeg - “文件中缺少所需的架构臂”

发布于 2024-08-28 11:59:28 字数 1547 浏览 10 评论 0原文

我正在尝试编译 x264 以在 iPhone 应用程序中使用。我看到这里有关于如何编译 ffmpeg 以在平台上使用的说明: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html ,但我似乎找不到任何在 iPhone 上编译 x264 的完整内容。我找到了这个源树: http://gitorious.org/x264-arm 似乎支持ARM平台。

这是我的配置行:

./configure --cross-prefix=/usr/bin/ --host=arm-apple-darwin10 --extra-cflags="-B /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/ -I /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/"

...在 configure 中,我使用气体预处理器脚本(上面的第一个链接)作为我的汇编器:

gas-preprocessor.pl gcc

当我开始编译时,它会分块一段时间,然后它会输出这些警告和一大堆未定义的符号:

ld: warning: option -s is obsolete and being ignored
ld: warning: -force_cpusubtype_ALL will become unsupported for ARM architectures
ld: warning: in /usr/lib/crt1.o, missing required architecture arm in file
ld: warning: in /usr/X11R6/lib/libX11.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libm.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libpthread.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libgcc_s.1.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libSystem.dylib, missing required architecture arm in file
Undefined symbols:

我的猜测是问题与“文件中缺少所需的架构臂”警告有关......有什么想法吗?

I'm trying to compile x264 for use in an iPhone application. I see there are instructions on how to compile ffmpeg for use on the platform here: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html , but I can't seem to find anything this complete for compiling x264 on the iPhone. I've found this source tree: http://gitorious.org/x264-arm that seems to have support for the ARM platform.

Here is my config line:

./configure --cross-prefix=/usr/bin/ --host=arm-apple-darwin10 --extra-cflags="-B /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/ -I /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/"

...and inside configure I'm using the gas-preprocessor script (first link above) as my assembler:

gas-preprocessor.pl gcc

When I start compiling, it chunks away for a little while, then it spits out these warnings and a huge list of undefined symbols:

ld: warning: option -s is obsolete and being ignored
ld: warning: -force_cpusubtype_ALL will become unsupported for ARM architectures
ld: warning: in /usr/lib/crt1.o, missing required architecture arm in file
ld: warning: in /usr/X11R6/lib/libX11.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libm.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libpthread.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libgcc_s.1.dylib, missing required architecture arm in file
ld: warning: in /usr/lib/libSystem.dylib, missing required architecture arm in file
Undefined symbols:

My guess would be that the problem has to do with the "missing required architecture arm in file" warning...any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一杆小烟枪 2024-09-04 11:59:28

检查此网站:http://github.com/gabriel/ffmpeg-iphone-build
文件:build-x264-armv6

你一定会喜欢它!

再见&祝你好运!

Check this site: http://github.com/gabriel/ffmpeg-iphone-build
File: build-x264-armv6

You will love it!

Bye & Good Luck!

小苏打饼 2024-09-04 11:59:28

许多开发人员在转换到 XCode 4.3 后在编译 FFMpeg 源代码时遇到问题。这主要是因为,与以前的版本不同,XCode4.3 作为捆绑包提供,并且最初不包含命令行工具。

我们尝试构建通用脚本;您可以在此处下载构建 FFMpeg 以及 XCode4.3 的完整环境:https://github.com/melnikov /ffmpeg4iphone_4.3

先决条件:

  1. 您必须在 Mac 上安装 XCode4.2 或 4.3
  2. 您必须安装 XCode 命令行工具(可以通过 XCode -> 首选项 -> 下载来安装)
  3. 您必须已经安装了 Mac 版 git。

说明和说明:

  1. 将构建脚本放入某个目录(例如 /tmp/ffbuild),在其上设置可执行标志(通过运行 'chmod +x ./build)
  2. 运行脚本。它将做什么:
  3. 它将检出最新版本的 FFMpeg 到 FFmpeg 目录中(如果您已经将 FFmpeg 检出到当前目录中,您可以安全地将其注释掉)
  4. 它将尝试检测 Xcode.app 的位置,如果 Xcode 则退出未安装,
  5. 它将尝试在 Xcode.app 中查找 gcc,如果未找到,则退出(如果未安装 Xcode Command Tools,则可能会发生这种情况)
  6. 如果上述步骤顺利运行,脚本将
  7. 创建 build_results 文件夹
  8. ,随后将运行 FFmpeg为 3 个不同的体系结构(armv6、armv7、i386)进行配置和制作,并将它们放入 build_results 文件夹内的相应目录中,
  9. 将运行 lipo 并创建通用库(并将它们放入 build_results/Universal)文件夹中。

顺便说一句,我已经在许多同事的 Mac 上测试了该脚本,其中一些往往不会在 Xcode.app 的 mdfind 中返回任何结果。因此,如果脚本返回“Xcode 未安装”,请随意将 XCODEPATH 变量设置为 Xcode.app 的路径

Many of the developers experience issues compiling FFMpeg sources after transition to XCode 4.3. This is mostly due to the fact, that unlike in previous releases, XCode4.3 comes as a bundle, and doesn't include the command-line tools initially.

We've tried to build the universal script; you can download the complete environment for building FFMpeg along with XCode4.3 here: https://github.com/melnikov/ffmpeg4iphone_4.3

PREREQUISITES:

  1. you have to have XCode4.2 or 4.3 installed on your Mac
  2. you have to have XCode command line tools installed (can be installed via XCode -> Preferences ->Downloads)
  3. you have to have git for mac installed.

INSTRUCTIONS and EXPLANATIONS:

  1. place build script into some directory (say, /tmp/ffbuild), set executable flag on it (by running 'chmod +x ./build)
  2. run the script. What it will do:
  3. it will checkout latest version of FFMpeg into FFmpeg directory (you can safely comment this out if you have already checked out FFmpeg into current directory)
  4. it will try to detect the location of your Xcode.app and will exit if Xcode is not installed
  5. it will try to locate gcc inside of the Xcode.app and will exit if it's not found (this may happen if Xcode Command Tools are not installed)
  6. if the above steps ran smoothly, script will
  7. create build_results folder
  8. will subsequently run FFmpeg configure and make for 3 different architectures (armv6, armv7, i386) and will put them into respective directories inside of build_results folder
  9. will run lipo and create universal libs (and will put them inside build_results/Universal) folder.

BTW, I've tested the script on a number of my colleague's macs, and some of them tend to not return any results in mdfind for Xcode.app. So, if the script will return 'Xcode is not installed', please feel free to set XCODEPATH variable to the path to Xcode.app

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文