0

我有看起来像这样的错误。

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_EGOPhotoViewController", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

"_OBJC_CLASS_$_EGOPhotoViewController", referenced from:
Objc-class-ref in ViewController.o
Symbol(s) not found for architecture i386
Linker command failed with exit code 1 (use -v to see invocation)

我创建了一个 ViewController 并在控制器代码中创建了一个按钮

- (IBAction)galleryBtnTapped:(id)sender {
    MyPhoto *photo = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/66601193/cactus.jpg"] name:@" First Photo"];
    MyPhoto *photo2 = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"] name:@"Second Photo"];
    MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:photo, photo2, photo, photo2, photo, photo2, photo, photo2, nil]];

    EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
    [self.navigationController pushViewController:photoController animated:YES];

    //[photoController release];
    //[photo release];
    //[photo2 release];
    //[source release];
}

其他与github 上的这个项目相同

4

2 回答 2

0

在此处输入图像描述请在Compile sources > EGoPhotoViewer.m中设置-fno-objc-arc标志,位于以下路径

单击您的项目>目标项目(不要选择项目测试)>编译源> EGoPhotoViewer.m

于 2012-10-16T13:20:08.067 回答
-1

看起来您没有链接到正确的二进制文件。要将二进制文件包含到项目中,您必须单击项目文件以显示您的目标。从那里,转到“构建阶段”选项卡,然后在“将二进制文件与库链接”下,确保您的 EGOPhotoViewer 库在那里。

这是它应该是什么样子的屏幕截图: 在此处输入图像描述

于 2012-10-16T13:19:47.847 回答