gpt4 book ai didi

ios - iPhone SDK 与静态库链接错误

转载 作者:技术小花猫 更新时间:2023-10-29 11:22:16 25 4
gpt4 key购买 nike

我已经构建了自己的静态库,其中包含要在我的项目中重复使用的组件,并且最近需要更新一堆类。具体来说,由于某些类更改了名称,因此更改了某些方法的签名。

现在发生的事情是,库可以自行编译,但是,当添加到应用程序项目时,该项目无法链接:

Ld build/Sucursales.build/Debug-iphoneos/Sucursales.build/Objects-normal/armv6/Sucursales normal armv6
cd /Users/nameghino/src/Sucursales
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -L/Users/nameghino/src/Sucursales/build/Debug-iphoneos -L/Users/nameghino/src/Sucursales/../../Library/MyLibraries/MSSharedLibrary-1.0.0 -F/Users/nameghino/src/Sucursales/build/Debug-iphoneos -filelist /Users/nameghino/src/Sucursales/build/Sucursales.build/Debug-iphoneos/Sucursales.build/Objects-normal/armv6/Sucursales.LinkFileList -dead_strip -lxml2 -ObjC -all_load -miphoneos-version-min=3.1 -framework Foundation -framework UIKit -framework CoreGraphics -lsqlite3.0 -framework CoreLocation -framework MapKit -lxml2 /Users/nameghino/src/MSSharedComponents/Frameworks/MSSharedLibrary/build/Debug-iphoneos/libMSSharedLibrary.a -o /Users/nameghino/src/Sucursales/build/Sucursales.build/Debug-iphoneos/Sucursales.build/Objects-normal/armv6/Sucursales

Undefined symbols:
"_OBJC_CLASS_$_DataCatalogService_GetSingleRow", referenced from:
objc-class-ref-to-DataCatalogService_GetSingleRow in libMSSharedLibrary.a(MSDataCatalogSpecification.o)
**"_OBJC_CLASS_$_DataCatalogService_ArrayOfString", referenced from:
objc-class-ref-to-DataCatalogService_ArrayOfString in libMSSharedLibrary.a(MSDataCatalogSpecification.o)
"_OBJC_CLASS_$_DataCatalogService_GetSingleRowResponse", referenced from:
objc-class-ref-to-DataCatalogService_GetSingleRowResponse in libMSSharedLibrary.a(MSSingleRowResultsParser.o)
"_OBJC_CLASS_$_DataCatalogService_GetMultiRowResponse", referenced from:
objc-class-ref-to-DataCatalogService_GetMultiRowResponse in libMSSharedLibrary.a(MSMultiRowResultsParser.o)
"_OBJC_CLASS_$_DataCatalogService_GetMultiRow", referenced from:
objc-class-ref-to-DataCatalogService_GetMultiRow in libMSSharedLibrary.a(MSDataCatalogSpecification.o)
"_OBJC_CLASS_$_DataCatalogService_HelloWorldResponse", referenced from:
objc-class-ref-to-DataCatalogService_HelloWorldResponse in libMSSharedLibrary.a(DataCatalogService.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status**

奇怪的是,在清理了大量项目之后(在应用程序和 lib 项目中),我仍然遇到同样的问题。即使在开始一个新项目后,问题仍然存在。

我也注意在清理和构建之间重启 Xcode 几次,但效果不佳。

关于去哪里看有什么想法吗?

最佳答案

您是否将库作为依赖项添加到项目中?参见 Xcode 3.1.1 and static libraries

如果您深入了解您的目标,库名称是否出现在“链接二进制文件”中与图书馆”小组?

查看编译器/链接器输出的日志。找到对链接器的调用。您的库是否出现在要链接的静态库列表中?

关于ios - iPhone SDK 与静态库链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2931457/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com