Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate symbol

Tags:

iphone

I recently added some openfeint code to my classes and changed them to .mm

All of a sudden I get errors that duplicate symbols are found in the object files when building.

ld: duplicate symbol _audioPlayer in blah blah /Objects-normal/i386/Stage2.o and /Users/blah blah .build/Debug-iphonesimulator/blah.build/Objects-normal/i386/Stage1.o

Why is it suddenly causing this error? What exactly is the error?

I have variables with the same name in different classes, it should be a problem?

Thanks

like image 782
some_id Avatar asked Jun 23 '26 20:06

some_id


2 Answers

You're probably declaring two variables with the same name in global scope (not inside interfaces), and the linker is complaining about that.

like image 69
ySgPjx Avatar answered Jun 26 '26 10:06

ySgPjx


This error can also occur if you import a .m file instead of .h.

#import "SomeClass.m"
like image 27
Murray Sagal Avatar answered Jun 26 '26 10:06

Murray Sagal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!