Undefined symbols for architecture i386

今天编译项目的时候,报错:

 

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

 

我只是将RequestServer.h和RequestServer.m拖到了项目中,而且我也选择了Copy items into destination group's folder(if needed),解决方法如下:

 

在Xcode 4.3.2的左侧项目文件列表中选中RequestServer.m文件,在右侧的File Inspector中找到Target Membership,其中有一项以项目名命名的CheckBox,将它选中后再编译即可。

你可能感兴趣的:(ios,iPhone)