I’ve seen several posts on this error, I’ve read all of them but with no success , I will be glad for a solution. Here is the output I recieve when compiling …
ld: duplicate symbol _pointOffsetArray in /Users/admin/Library/Developer/Xcode/DerivedData/Display_Cubes_2-acsuoldwvhwsnjfowhhxfsmdeekc/Build/Intermediates/Display Cubes 2.build/Debug-iphonesimulator/Display Cubes 2.build/Objects-normal/i386/Display_Cubes_2ViewController.o and /Users/admin/Library/Developer/Xcode/DerivedData/Display_Cubes_2-acsuoldwvhwsnjfowhhxfsmdeekc/Build/Intermediates/Display Cubes 2.build/Debug-iphonesimulator/Display Cubes 2.build/Objects-normal/i386/Display_Cubes_2AppDelegate.o for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
What it means is that you probably have a global symbol called _pointerOffsetArray (or something similar) defined in two different files. Look for all instances where this symbol is globally defined, and if you do find two different declarations:
If they are needed only in their respective files, qualify them with
statickeyword.If the symbol needs to be “shared” between the two files, then make sure that it is defined at only one place. You can refer to it in the other file by using the
externqualifier to declare it (in this other file).If you don’t know already, you really should read up on how the
externandstaticqualifiers work.In your case the symbol is probably defined twice in
Display_Cubes_2ViewController.morDisplay_Cubes_2AppDelegate.m(or, most likely, you are importing a header file in both of these files which defines this symbol).