Duplicate characters for i386 clang architecture

I saw several google and stackoverflow posts related to this error, I read them all, but still getting the problem, I will be happy for the solution. Here is the mesage error I get when compiling ...

the directory was not found for the option '-L / Users / somefolder / Documents / Bharat / MyApp copy / GoogleAdMobAdsSDK' duplicate _OBJC_CLASS _ $ _ AppDelegate in: / Users / madept / Library / Developer / Xcode / DerivedData / Alpha -dvvymdlmzseytagllsmbbrxdildut Intermediates / Alpha.build / Debug-iphonesimulator / Alpha.build / Objects-normal / i386 / AppDelegate-56890B6B994A4284.o

Thank.

+56
objective-c ios5 admob
Sep 05 '12 at 10:41
source share
24 answers

Finally, I got a solution -

+2
Sep 05 '12 at 12:12
source share

Another reason this error often occurs is to accidentally import the .m file instead of .h.

+234
07 Oct '12 at 19:52
source share

Steps:

  • Check assembly phases in target settings.
  • Check if the file exists twice or once.
  • If the file exists, delete it twice. If not delete the file at the bottom which is the last.
  • Create again.
+57
May 20 '13 at 12:12
source share

Just add to possible solutions.

In my case, I accidentally declared and initialized a variable in the header file.

For example, this is not true:

Myfile.h

#import <Foundation/Foundation.h> NSInteger const ABCMyConstant = 6; 

It should be:

Myfile.h

 #import <Foundation/Foundation.h> NSInteger const ABCMyConstant; 

Myfile.m

 #import "MyFile.h" NSInteger const ABCMyConstant = 6; 
+25
Mar 19 '14 at 17:07
source share

Go to the "Setup and Search" section. There are no common blocks and set NO . And create again, you will not get this error again.

+20
Aug 04 '16 at 8:29
source share

I found that I was getting an error when I had a const declared in a .m file with the same name as another const in another .m file. Both # files include the same parent file.

+11
May 2 '13 at 6:11
source share

I just experienced this after recreating the model class for Core Data. The menu option for creating feature classes created a duplicate model class. as soon as I removed the cheat, the error disappeared ...

+8
Nov 11 '12 at 0:00
source share

Linker errors always indicate a problem with using the library or import issues.

Sometimes an error occurs when you import a .m file instead of a .h file.

Please check your code and find the import operator .m in one of your header files (extension .h), I had a similar problem and an error occurred with 14 repeated characters.

Check if you have imported ViewControler.m instead of its .h, so it should be like this:

  import "ViewController.h" 

and your AppDelegate.h should look something like this:

 import "UIKit/UIKit.h" import "ViewController.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong,nonatomic) ViewController *mainController; @end 

Always remember to import header files, not .m

+7
Mar 21 '15 at 13:02
source share

If other people have tried all the other answers and still do not work, try opening the .xcodeproj file with your favorite text editor and find the name of the class that gives you the problem. Before doing this, close Xcode. The file should have one line for .h and another line for .m. If there are duplicates, delete them, save the file and rebuild.

+4
Jun 03 '13 at 23:03
source share

I had this problem with a wireframe that I knew worked in another project. I copied files from another project and added it to this. Then, when I created it, I got 76 repeated errors.

A simple solution for me was to remove -ObjC from other Linker flags. This was not the case in the previous draft. As soon as I did this, the warning disappeared and the project was successfully completed.

+4
Mar 27 '14 at 6:49
source share

I got this error when I had a static library included in the main project, as well as a second library that also had a link to the library. This is pretty confusing, so maybe it's clearer.

MyWorkspace + Main project + Link to library 1 + Link to library 2 + Library 1 + Library 2 + Link to library 1

I removed the link to library 1 from the main project and the error went away.

+3
Jan 23 '13 at 19:17
source share

Another reason may be that when creating a distribution version, the project aims at a simulator instead of a real device. It also causes this error message.

+3
Jan 15 '14 at 11:37
source share

The easiest way to resolve this is with Xcode 7.0 or later, just do not modify Common Blocks so that it does not solve your problem. Try this target Project> Build Setting> No Common Blocks, I changed it to NO.

+2
May 2 '16 at
source share

In some cases, you may also get the error "duplicate characters for architecture ..." due to the fact that you accidentally declared a constant with the same name in two different files.

+2
May 15 '16 at 15:59
source share

I had this where I defined the same C function twice. In two different .m files. Just delete one of the definitions and voila.

+1
Mar 14 '15 at 19:40
source share

I tried to clear the project, erased all the data received. Nothing worked out. Atlas, it worked for me.

enter image description here

Another reason may be that when creating a distribution version, the project is aimed at the simulator, and not at the real device. It also causes this error message.

+1
Nov 06 '18 at 6:31
source share

It was different for me, I copied the implementation methods of the as is class and iVars was also copied ... so there are two sets in the iVars world, and the compiler continued to complain about duplicate ivars before linking * .o files.

Reading the results helped to remove all duplicate ivars ... thanks to a new function in which you do not need @synthesize all your properties ... the error is gone ...

0
09 Oct '12 at 16:18
source share

I have the same error when setting up OCMock. I fixed it by adding libOCMock.a to the Copy Files section of Building Phase

0
Mar 07 '14 at 14:20
source share

I had this error after I copied and pasted a test file into the project, forgetting to change the interface name and implementation string:

 @interface TDInputValidationsTests : XCTestCase 

and

 @implementation TDInputValidationsTests 

Stupid mistake ... I also suggest looking at the project build phase tab to check for duplicates. Deleting data and creating a clean assembly can also help.

0
Jun 05 '14 at 9:35
source share

I imported files from another project, it also had a main.m file. Thus, in general, I had two main.m files, deleting one resolved the problem for me.

0
Sep 20 '14 at 13:03
source share

Sometimes believe it or not, Xcode twists the project file. The only solution we found was to manually remove each link to the offending file using a text editor, and then re-add the files to Xcode.

0
Oct 07 '14 at 15:56
source share

Note to yourself: "READ THE ERROR!"

In my case, it says the following: duplicate symbol _OBJC_CLASS_$_SATCoreData in:

Translation: A Class C Object named SATCoreData duplicated.

Then it sets the path for both occurrences of the character. Reading the path points to two class files ending in .o . If you look at both classes, you will find something suspicious. In my case, I accidentally gave two classes the same name. One class that I had inside the file of another class, because I tested something and was too lazy to create a separate class. Hope this helps someone.

0
Oct 24 '15 at 20:05
source share

I had this problem and am stuck for a while. This caused a problem for me: I wrote several boolean .h files (between #import and @interface) and used them in my .m file

I just deleted them from my .h file and copied them to the same place in my .m file, and the build was successful.

0
May 15, '16 at 19:10
source share

Adapted from https://stackoverflow.com/a/3129608/

What you can do is put in your header ( MyConstants.h ):

 extern const int MyConstant; extern NSString * const MyStringConstant; 

And in the source file, include the header above, but define the constants ( MyConstants.m ):

 const int MyConstant = 123; NSString * const MyStringConstant = @"SomeString"; 

Then you just need to include the header in any other source file that uses any of these constants. The header simply declares that these constants exist somewhere, so the compiler will not complain, because it is the job of the linker to resolve these constant names. The source file containing your constant definitions is compiled, and the linker sees that these are constants, and resolves all the links found in other source files.

The problem with declaring and defining a constant in the header (which is not declared as static ) is that the compiler treats it as an independent global for every file that includes this header. When the linker tries to link all compiled sources together, it encounters the global name as many times as you included MyConstants.h .

0
05 Oct '16 at 2:58
source share



All Articles