【发布时间】:2012-08-14 11:15:27
【问题描述】:
(我在 VideoLAN 论坛上发布了这个问题,但还没有接受者。我知道 SO 社区不会让我失望。)
我正在尝试为 iOS 构建 MobileVLC 项目。我已经完成了命令行过程来构建项目,经过http://forum.videolan.org/viewtopic.php?f=12&t=103331 和http://forum.videolan.org/viewtopic.php?f=12&t=103271 中描述的一些调整后,构建脚本几乎运行完成。当它试图让 Xcode 构建最终项目时,它会出错。所以我将它加载到 Xcode 并尝试构建,我可以看到错误,这是我使用 -v 链接器标志时得到的:
Ld /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos/VLC.app/VLC normal armv7
cd /Users/bp/Desktop/vlc/MobileVLC
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L/Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos -L/Users/bp/Desktop/vlc/MobileVLC/External/MobileVLCKit -L/Users/bp/Desktop/vlc/MobileVLC/External/MediaLibraryKit -F/Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos -filelist /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Intermediates/MobileVLC.build/Debug-iphoneos/MobileVLC.build/Objects-normal/armv7/VLC.LinkFileList -dead_strip -Wl,-no_pie,-v -fobjc-link-runtime -miphoneos-version-min=5.1 -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -framework AudioToolbox -framework QuartzCore -liconv -lz /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos/libMobileMediaLibraryKit.a -lsqlite3 -lstdc++.6 -lbz2 -lxml2 -framework CoreData -framework CoreText -framework MediaPlayer /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos/libMobileVLCKit.a -o /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos/VLC.app/VLC
@(#)PROGRAM:ld PROJECT:ld64-133.3
configured to support archs: armv6 armv7 i386 x86_64
Library search paths:
/Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos
/Users/bp/Desktop/vlc/MobileVLC/External/MobileVLCKit
/Users/bp/Desktop/vlc/MobileVLC/External/MediaLibraryKit
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib
Framework search paths:
/Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/
LLVM version 3.1svn, from Apple Clang 4.0 (build 421.0.60)
ld: 'non_lazy_ptr' in /Users/bp/Library/Developer/Xcode/DerivedData/MobileVLC-ctcjnpeqzuhulxcmjlhrjnyzpzil/Build/Products/Debug-iphoneos/libMobileVLCKit.a(libdeinterlace_plugin_la-deinterlace.o) contains undefined reference for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
据我所知,libMobileVLCKit.a 文件已链接到 MobileVLC 项目,所以我不确定接下来要查找什么,因为我在任何代码中都找不到对 non_lazy_ptr 的任何引用,并且框架引用了所有看起来不错。即使您不知道解决方案,任何关于在哪里寻找问题的想法都将不胜感激。谢谢。
编辑:这是一个屏幕截图,显示了 MobileVLC 项目的“构建阶段”选项卡中的所有内容。
编辑 2:我在 VideoLAN 论坛上的帖子得到了一些“我也是”的回复,以及一个与其他用户的错误非常相似的错误。这是错误消息的最后一行:
ld: '_AmplifyFloat' in /Users/**/MobileVLC/ImportedSources/VLCKit/build/Release-iphoneos/libMobileVLCKit.a(libvolume_neon_plugin_la-volume.o) contains undefined reference for architecture armv7
这是 VideoLAN 论坛上的帖子:http://forum.videolan.org/viewtopic.php?f=12&t=103433
编辑 3:我从 VideoLAN 的 git 存储库中获取了一份新的源代码副本,并查看了 user1071136 在下面提供的答案,最终得到了与他们得到的完全相同的错误。
我在 Stack Overflow 上发现了一个类似的错误,表明解决方案是检查以确保 Apple LLVC compiler 4.0 - Code Generation 构建设置中的 Generate Position-Dependent Code 选项设置为否。但像往常一样尝试让 VLC 运行iOS,这也是一个死胡同,因为构建设置已经设置为否。
【问题讨论】:
-
库文件上的 ranlib -c 可能会解决此问题。您还可以检查目标的框架搜索路径。我不是专业人士,但我认为这些可以帮助你。
-
我在派生文件位置的 libMobileVLCKit.a 文件上执行了 ranlib 命令,它只是返回了一堆关于如何没有符号的行。另外,我检查了 MobileVLC 项目和 MobileVLCKit 项目中的目标框架搜索路径,它们都是空白的。
-
我的一位同事发现了同一问题的最近链接,但我仍然不确定我应该寻找什么:comments.gmane.org/gmane.comp.video.videolan.vlc.devel/87906