【问题标题】:XCode 4.2 cocos2d iPhone project failed. id: library not found for -lz.1.2.3XCode 4.2 cocos2d iPhone 项目失败。 id: 找不到 -lz.1.2.3 的库
【发布时间】:2011-10-30 22:44:34
【问题描述】:

刚刚用 4.2 替换了我的 XCode 4.0.1。尝试运行我目前正在开发的 iPhone 游戏项目,遇到错误:

ld: 找不到 -lz.1.2.3 的库 命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ 失败,退出代码为 1

全文:

Ld "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator/Hit The Road.app/Hit The Road" normal i386
    cd "/MyProjects/Hit The Road"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator -F/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator -filelist "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Intermediates/HitTheRoad.build/Debug-iphonesimulator/Drive.build/Objects-normal/i386/Hit The Road.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz -ObjC -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -lz.1.2.3 -weak_framework MapKit -framework CoreLocation -weak_framework GameKit -framework AddressBookUI -framework AddressBook -framework CFNetwork -framework MobileCoreServices -lsqlite3.0 -framework SystemConfiguration -framework Security -framework QuartzCore -weak_framework UIKit -framework OpenGLES -framework OpenAL -framework AudioToolbox -framework AVFoundation -weak_framework Foundation -framework CoreGraphics -o "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator/Hit The Road.app/Hit The Road"

试图找出问题所在,发现可能与 Mac OS X 部署目标有关。所以我尝试将其设置为 10.4 10.5 和 10.6。不幸的是,它没有帮助。

我正在使用 MacOS 10.6.8

以前有人遇到过这样的错误吗? 也许有人至少知道这个错误是关于什么的?

【问题讨论】:

    标签: iphone objective-c xcode cocos2d-iphone ios5


    【解决方案1】:

    文件导航器中单击项目,然后选择目标。向下滚动到 Linked Frameworks and Libraries 并找到正在使用的 libz 库并将其删除,名称可能会显示为红色。接下来,单击“+”并输入 libz 并添加 1.2.3 或更高版本。通常,只需选择 libz.dylib 即可。最后,清理并重建。

    【讨论】:

    • 正如安德鲁所说。确切的原因是我相信 iOS 5.0 现在使用 libz 1.2.5。我个人的偏好是链接 libz1,因为如果 2.0 发布它可能会中断。这通常也是其他链接的原因,例如 libxml 和 sqlite。
    猜你喜欢
    • 2012-05-13
    • 2011-12-10
    • 2012-07-16
    • 1970-01-01
    • 2013-01-23
    • 2016-06-12
    • 2012-03-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多