“symbol(s) not found for architecture i386” problem using ShareKit

风流意气都作罢 提交于 2019-12-10 17:26:48

问题


I want to use the http://getsharekit.com framework for future iOS projects. Hence I started testing out the framework.

But I already get the following error:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SHKItem", referenced from:
  objc-class-ref in ShareKitTestAppDelegate.o
"_OBJC_CLASS_$_SHKActionSheet", referenced from:
  objc-class-ref in ShareKitTestAppDelegate.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

Often, as far as I know, these problems arise if header files are wrongly imported. But I don't see any error here in the following code where the problem above occurs:

#import "ShareKitTestAppDelegate.h"
#import "SHK.h"
#import "SHKItem.h"
#import "SHKActionSheet.h"
- (IBAction) letshare:(id)sender
{  
   // Create the item to share (in this example, a url)
   NSURL *url = [NSURL URLWithString:@"http://getsharekit.com"];
   SHKItem *item = [SHKItem URL:url title:@"ShareKit is Awesome!"];

   // Get the ShareKit action sheet
   SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

   // Display the action sheet
   [self.window addSubview:actionSheet];
}

I also included the ShareKit Headers Folder into HeaderSearchPath Build-Options, because of searching for all the headers.

But I don't see any error here or anything missed.

Can somebody help me?

With best regards,

Andreas


回答1:


Read this http://getsharekit.com/install/.

Have you added the frameworks?




回答2:


I had a similar problem with the following linker error:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_SHK"

I resolved it by adding SHK.m to compiled sources under Project settings->Target->Build Phases. Not sure why SHK.m was not in the compiled sources list, and it was working previous to duplicating the Target. After the duplication I couldn't link any of the targets.

Adding SHKItem.m or SHK.m to compiled sources might help you if they aren't there already.



来源:https://stackoverflow.com/questions/6889940/symbols-not-found-for-architecture-i386-problem-using-sharekit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!