我已阅读与此错误相关的许多帖子,但仍面临此问题。 我在我的项目中使用MMDrawerController,当我宣布MMDrawerController在应用程序委托文件中像MMDrawerController *drawerController;
2个体系结构i386的重复符号,链接器命令失败,退出代码为1
则可以正常工作,但是当我宣布它Constant.h文件并导入Constant.h文件中的appDelegate文件,并尝试然后它给我以下错误
duplicate symbol _drawerController in:
/Users/icecube/Library/Developer/Xcode/DerivedData/VenueFinder-eowuotuoweptcnfmzowyaajchlnv/Build/Intermediates/VenueFinder.build/Debug-iphonesimulator/VenueFinder.build/Objects-normal/i386/NavigationViewController.o
/Users/icecube/Library/Developer/Xcode/DerivedData/VenueFinder-eowuotuoweptcnfmzowyaajchlnv/Build/Intermediates/VenueFinder.build/Debug-iphonesimulator/VenueFinder.build/Objects-normal/i386/ViewController.o
duplicate symbol _drawerController in:
/Users/icecube/Library/Developer/Xcode/DerivedData/VenueFinder-eowuotuoweptcnfmzowyaajchlnv/Build/Intermediates/VenueFinder.build/Debug-iphonesimulator/VenueFinder.build/Objects-normal/i386/NavigationViewController.o
/Users/icecube/Library/Developer/Xcode/DerivedData/VenueFinder-eowuotuoweptcnfmzowyaajchlnv/Build/Intermediates/VenueFinder.build/Debug-iphonesimulator/VenueFinder.build/Objects-normal/i386/AppDelegate.o
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
不知道我在做什么错?我已经检查并没有导入.m文件而不是.h
如果 MMDrawerController *drawerController;
此声明位于appDelegate文件中,但它工作正常,但是如果此声明位于Constant.h文件中并且导入了AppDelegate.m文件中的Constant.h文件那么它会给出错误。在这两个类像
从xcode中删除项目派生数据并退出xcode并重新构建。 – jigs
显示drawerController的声明。 –
MMDrawerController * drawerController;当我将这个声明从appDelegate文件移动到Constant.h文件..然后构建失败这个上述错误 – Divyesh