【问题标题】:apple mach-o linker (id) error getting confused with this苹果 mach-o 链接器(id)错误与此混淆
【发布时间】:2012-08-23 07:45:39
【问题描述】:

我刚刚在 xcode 4.2 中打开了在 xcode 3.1.5 版本中制作的项目,并且收到以下错误,任何人都可以在这方面帮助我。

1)

Ld /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer normal i386
    cd /Users/hasmukh.mandavia/Desktop/DevelopmentArea/ARecipe
    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/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib/gstreamer-0.10 -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib/pkgconfig -F/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator -filelist /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Intermediates/ARecipeViewer.build/Debug-iphonesimulator/ARecipeViewer.build/Objects-normal/i386/ARecipeViewer.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lpocketsphinx -lsphinxbase -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30100 -framework Foundation -framework UIKit -lsqlite3.0 -framework AudioToolbox -framework CFNetwork -liconv -lcv -lcxcore -framework CoreGraphics -framework QuartzCore -framework OpenGLES -o /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer

ld: library not found for -lcv
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

2)

GenerateDSYMFile /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app.dSYM /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer
    cd /Users/hasmukh.mandavia/Desktop/DevelopmentArea/ARecipe
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/usr/bin/dsymutil /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer -o /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app.dSYM

error: unable to open executable '/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer'

【问题讨论】:

    标签: iphone ios5 xcode4.2 xcodebuild


    【解决方案1】:

    1.) 正如第一个错误所说

    ld: library not found for -lcv
    

    这意味着您的项目需要'cv' 的静态库和 它要么不在您的项目中,要么放置在其他位置(如果您正在使用它)

    或

    您在构建设置中添加了额外的编译器标志(如果您没有在代码中使用该库)。在构建设置中遵循编译器标志。

    -liconv -lcv -lcxcore
    

    将 cv 库放在正确的位置。(以便它可以包含在项目中)。

    2.) 第二个错误可能是因为 .app 文件尚未在派生数据目录中创建。 转到错误显示的路径,即验证 .app 文件是否存在。

    error: unable to open executable '/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer'
    

    【讨论】:

    • 在项目的构建设置中搜索“其他链接器标志”。我的错误是链接器标志而不是编译器。尝试从 XCode 首选项更改 DeriveData 目录。它将在新位置创建构建。并查看 .app 文件内部是否存在 ARecipeViewer 文件。
    • -lpocketsphinx -lsphinxbase 我已经在其他链接器标志中添加了这两个标志,但仍然出现错误
    • 这些文件 -lcv 和其他文件在框架中。因此,请查找在您的项目中添加了哪些框架。日志建议 -framework AudioToolbox -framework CFNetwork -liconv -lcv -lcxcore -framework
    • 还要确保构建设置中的 .pch 文件与项目中的文件同名。 (第二个错误)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-02
    • 2011-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-26
    相关资源
    最近更新 更多