Symbol duplication error for i386 architecture

I got this error when I tried to build:

"duplicate character __Z8ERRCHECK11FMOD_RESULT in:

/Users/codemenmini2012-2/Library/Developer/Xcode/DerivedData/MagicSleepFullVersion-agxulkdijnxbqmbuigucmrczufyw/Build/Intermediates/MagicSleepFullVersion.build/Debug-iphonesimulator/MagicSleepFullVersion.build/Objects-normal/i386/MagicSleepViewController.o /Users/codemenmini2012-2/Library/Developer/Xcode/DerivedData/MagicSleepFullVersion-agxulkdijnxbqmbuigucmrczufyw/Build/Intermediates/MagicSleepFullVersion.build/Debug-iphonesimulator/MagicSleepFullVersion.build/Objects-normal/i386/MagicSleepViewControllerIpad.o 

ld: 1 duplicate character for i386 architecture clang: error: linker command failed with exit code 1 (use -v to invoke the call)

How to solve these guys?

+4
source share
8 answers

An error can occur when copying and pasting the contents of one file into another file with its interface name, which means two classes with the same interface name.

In your code, you have two different files with the same interface name.

+19
source

For me, this error occurred because I was stupid enough to copy the entire folder of the loaded lib into the project, and there was a demo project inside it. Therefore, I had two main.m files. Hope this helps anyone!

+5
source

In my case, I accidentally imported a .m file instead of a .h file. Hope this helps someone in this stupid mistake.

+4
source

when you create bool variables with the same name in two different classes, then this error occurs. "duplicate the __Z8ERRCHECK11FMOD_RESULT character in" so check your two classes MagicSleepViewController.m and MagicSleepViewControllerIpad.m. for the same bool variables.

Change the bool variable name, your problem will be solved.

+3
source

It looks like you have at least one (possibly more) character (or methods, functions, etc.) that is duplicated between MagicSleepViewController.m and MagicSleepViewControllerIpad.m.

You need to either 1) change the names of one set of duplicated methods, or 2) find out how to combine MagicSleepViewController.m and MagicSleepViewControllerIpad.m so that the same code works on both iPhone and iPads (for example, using runtime conditional expressions or something else to determine which device your code is running on).

+2
source

I had #defines placed in two files that were exactly the same ... DOH.

0
source

Finder search for named duplicates helped me.

0
source

The problem in my case was caused by several links in the "Compilation Sources". So I deleted one of Project-> Build Phases-> Compile Sources.

0
source

All Articles