IPhone - Using reusability to duplicate _OBJC_IVAR character

I have added Apple Reachability files to my project and I am already getting errors. I did not even add these files to any of my classes, but added them only to my project. How can I get this error?

When compiling, I get the following error:

ld: duplicate symbol _OBJC_IVAR_$_Reachability.localWiFiRef in /Users/webmaster/Dropbox/iPhone-Development/Official-Projects/PUC/build/PUC.build/Debug-iphonesimulator/PUC.build/Objects-normal/i386/Reachability-B40F6D608A62C635.o and /Users/webmaster/Dropbox/iPhone-Development/Official-Projects/PUC/build/PUC.build/Debug-iphonesimulator/PUC.build/Objects-normal/i386/Reachability-823B59DA9A9B0D23.o collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 

Note. I am using a Three20 project, so I'm not sure if this could be somehow conflicting?

+6
ios objective-c iphone reachability
source share
2 answers

So, I figured it out. I realized that since I use ShareKit, it also includes Reachability, so it worked twice in my project, I just didn't understand it.

+8
source share

You need to # import your own .h class into your .m. Otherwise, #import "Reachability.h" occurs twice, and I suppose there is a variable called localWiFiRef defined in Reachability.h, which is now declared twice and, therefore, is a "duplicate character" error.

However, you will not need #import "Reachability.h" in .m.

0
source share

All Articles