views:

33

answers:

2

I'm following a tutorial from chapter 12 of the book "Beginning iPhone 3 Development." When I try to build the project I get an error. The book came with the project files, so I went through every file in my Classes directory and copied and pasted the code from the example project so that they are identical. This has solved my build errors in the past. I checked that the same frameworks were installed and the files in the Other Sources and Resources folder are identical. Still, when I try to build, I get the following build error:

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

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

From what I can see my project is identical to the one supplied with the book, which I can build and run successfully. What could possibly still be different that is causing this error?

A: 

Use diff(1) between the two projects' project.pbxproj files and find out.

Peter Hosey
There's a lot of things that diff outputs. What should I be looking for?
awakeFromNib
Differences. Every difference between the two projects is potentially a culprit. You'll have to look through them to see which one(s) are the cause of the problem.
Peter Hosey
A: 

Clean the project then try again, sometimes strange things happen. Check the build configurations between the two projects to see if they have any differences (building for the same architecture, sdk, etc.). Since you have duplicate symbols my first guess would be that Clean will solve your issue.

theMikeSwan
Cleaning the project didn't help. I also tested them using the same build configurations and that's not the problem either.
awakeFromNib