views:

60

answers:

1

When I try to build my project I get the following error.

ld: duplicate symbol .objc_class_name_GLFunView in /Users/gin/Documents/development/GLFun/build/GLFun.build/Debug-iphonesimulator/GLFun.build/Objects-normal/i386/GLFunView-7A51E8797CBB3D72.o and /Users/gin/Documents/development/GLFun/build/GLFun.build/Debug-iphonesimulator/GLFun.build/Objects-normal/i386/GLFunView-7A51E8797CBB3D72.o

What is this error about? How can I track down where the error is? XCode usually highlights the code that has problems, but for this error it's not showing anything? It doesn't have anything to do with Interface Builder does it?

My research indicates that this might be caused by including something twice, but I don't understand how that's possible since I'm not using any #include statements, I'm only using #import statements.

Here's some more of the build output:

Ld build/Debug-iphonesimulator/GLFun.app/GLFun normal i386 cd /Users/gin/Documents/development/GLFun setenv MACOSX_DEPLOYMENT_TARGET 10.5 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk -L/Users/gin/Documents/development/GLFun/build/Debug-iphonesimulator -F/Users/gin/Documents/development/GLFun/build/Debug-iphonesimulator -filelist /Users/gin/Documents/development/GLFun/build/GLFun.build/Debug-iphonesimulator/GLFun.build/Objects-normal/i386/GLFun.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -o /Users/gin/Documents/development/GLFun/build/Debug-iphonesimulator/GLFun.app/GLFun

+2  A: 

My guess is you're @implementing GLFunView twice in the same file (GLFunView.m). Perhaps you meant to implement GLFunView and then implement a category on it, and forgot the category name?

Kevin Ballard
There is no @implementing in GLFunView.m.
awakeFromNib
no, but there's at least one `@implementation`. If you have 2 @implementation GLFunView lines, you're implementing the class twice. If you do have that, perhaps one was meant to be an `@implementation GLFunView (SomeCategory)`?
Kevin Ballard
Or perhaps, as I mentioned in a comment above, your GLFunView.h has a `@implementation GLFunView` somewhere in it?
Kevin Ballard
As I stated before I have used XCode's search function to look for "@implement" in the whole project and nothing was found.
awakeFromNib
@awakeFromNib, you hace to have at least one `@implementation` for every class you have or you be getting a whole list of warnings about classes not being fully implemented and missing method definitions. The standard pattern for classes is: in .h file `#import <Cocoa/Cocoa.h>``@interface MyClass : MySuperClass` `{` ivars `}` `@property` for each property,methods`@end`in .m file`#import "MyClass.h"``@implementation MyDocument``@synthesize` for each propertyimplementation of methods`@end`If Xcode isn't finding `@implementation` then you need to _look_ at the file in question yourself.
theMikeSwan
@awakeFromNib, as theMikeSwan says, you absolutely need `@implementation` in order to create classes. If you really searched for "@implement", maybe you have find set on Whole Words? You really need to pop open GLFunView.m and actually look at what's in that file.
Kevin Ballard