build failed with: ld: duplicate symbol _OBJC_CLASS_$_Algebra5FirstViewController

It look like the class Algebra5FirstViewController is compile multiple time.

Can you make sure that the .m and .mm is only included once in your project sources in Xcode? You can also confirm this by checking in the compile log (last icon at the right, next to the breakpoints icon) and see that confirm that it is only compiled once.

Also, if this class is part of a library that you link against and you have a class with the same name, you could have the same error.

Finally, you can try a clean and rebuild, just in case the old object files are still present and there is some junk in the compiled files. Just in case…

EDIT

I also note that the second reference is made in the file for ExercisesViewController. Maybe there is something in this file. Either you #imported the Algebra5FirstViewController file instead of the .h, or the ExercisesViewController has @implementation (Algebra5FirstViewController) instead of @implementation (ExercisesViewController), or there was some junk with this file that will cleaned with a Clean an Rebuild.

Leave a Comment