【问题标题】:getting linking error due to different library for ios and iphonesimulator?由于 ios 和 iphonesimulator 的库不同而导致链接错误?
【发布时间】:2011-09-21 15:02:43
【问题描述】:

我正在使用 libiVisualizationChart.a 库,iphoneos 和 iphonesimulator 有单独的库。我已经在 xcode 项目中添加了两个库,并在 Library Search Path 中提到了这两个库路径,但我只能为模拟器而不是设备构建。 谁能帮助我为什么会出现链接错误?

错误:

  "_OBJC_CLASS_$_VSColor", referenced from:


      objc-class-ref-to-VSColor in ChartView.o


  "_OBJC_CLASS_$_VSTransform3D", referenced from:


      objc-class-ref-to-VSTransform3D in ChartView.o

【问题讨论】:

    标签: objective-c ios linker ios-simulator static-libraries


    【解决方案1】:

    确保它们是弱链接。在您的项目设置中,在 Build Phases 下,有“Link Binary With Libraries”找到这两个库并将它们设置为可选。这应该可以清除链接错误。

    【讨论】:

      【解决方案2】:

      您可以尝试在构建设置中更改库搜索路径中库的顺序。 对于设备构建 iphoneos 库应该在 iphonesimulator 库之上,反之亦然。

      让它应该工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-25
        • 2015-01-14
        • 1970-01-01
        • 2017-06-09
        • 1970-01-01
        相关资源
        最近更新 更多