The command / Xcode.app / Contents / Developer / Toolchains / XcodeDefault.xctoolchain / usr / bin / clang failed with exit code 1

I am trying to make an application that reads pdf using the pdf bundle in Xcode 4.3, but this gives me the following error:

ld: duplicate symbol _OBJC_METACLASS_$_OverlayManager in /Users/dt4it/Library/Developer/Xcode/DerivedData/MyPdf4-bmkjglhhvneluqcbwpceiqjvdcmq/Build/Intermediates/MyPdf4.build/Debug-iphonesimulator/MyPdf4.build/Objects-normal/i386/OverlayManager-D0866CFD31A05E68.o and /Users/dt4it/Library/Developer/Xcode/DerivedData/MyPdf4-bmkjglhhvneluqcbwpceiqjvdcmq/Build/Intermediates/MyPdf4.build/Debug-iphonesimulator/MyPdf4.build/Objects-normal/i386/OverlayManager-B31AE7412100AF6D.o for architecture i386 Command /Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1 

any help please ??

+74
ios objective-c iphone ipad
Apr 29 '12 at 14:40
source share
20 answers

Project Settings> In the "Goals" section, select the project> Generate Phases> open "Compilation Sources" and "Copy Package Resources". Check if any files are marked in red. If so, just delete it. Then clean and run.

Worked for me.

+92
Sep 20 '13 at 12:16
source share

Make it clean. product > clean . Terminal cleanup and reboot did not work for me, cleanup did.

+30
May 17 '13 at 1:19
source share

I had the same error and no one seemed to respond to StackOverflow, which really works. My problem was that I was trying to copy a project that was in the command repository. It turns out that in the ignore file, all files with the *.pch were ignored from the repository commit. This means that when I went to get the project out of the repo, the .pch file .pch missing, thereby throwing this error.

Fortunately, I had a copy of the project and I could just copy the .pch file, and then I could compile it just fine.

Hope this helps?

+14
Oct 29
source share

Go to the target settings, tab of the totals, find the "Deployment Goal" and increase it.

+5
May 27 '13 at 18:23
source share

I am also facing this problem. And cc, I was looking for help in SO instead of using common sense and checking for the error message.

The last part of the error message was the same as you.

 Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 11 

But a few lines above I found:

 In file included from /Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/RealEstateFinder-Prefix.pch:26: /Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/Config/Config.h:174:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] http://www.myserver.com/apps/mobile/rest.php?id=12 

Which points to my Config.h file.

Happy coding!

+2
Mar 19 '15 at 15:43
source share

You accidentally included the .m file of the OverlayManager instead of the .h file inside the OverlayManager class itself! Basically, the compiler already knows to compile the .m file, but when you #import it, the compiler tries to include it in the line with the same source file, thereby generating repeated characters. But your case is unique because you are # importing.m of the actual class .m file! It recursively compiles the OverlayManager class.

+1
Apr 29 '12 at 16:14
source share

The same thing happened to me, and I found that I forgot to put "at the end

 #import "CPDConstants.h 

therefore instead

 #import "CPDConstants.h" 
+1
Jul 21 '13 at 20:20
source share

For me, this error appears after cloning a project from the repository. Someone removed the empty space from the project name (renamed: "Project" to "TheProject"), which caused some Build Settings errors for invalid paths.

Sometimes reading all error logs is not a bad idea ....

+1
Oct 20 '14 at 11:03
source share

Try this - click on the name of your project in the list of files / folders on the left in Xcode (at the very top of the list). Look at the Goals section on the left side of the window on the right. Probably there are two of these, and the second is a "test." Right-click on this item and select delete. Then try to start the project again.

+1
Aug 25 '15 at 8:34
source share

removing ~/Library/Developer/Xcode/DerivedData helped me.

link: link

+1
May 11 '16 at 4:15
source share

Here you need to consider the * .pch file. If you are including from an external library, you need to make sure that you are including after #ifdef OBJC and before #endif. If you try to make your inclusion outside of this condition, this may cause a compiler error.

0
Apr 28 '13 at 17:27
source share

If this happens on a team using git. One of the team members added the class from an external source, but did not copy it to the repo directory. The local version compiled perfectly, but continuous integration ended with this error.

Recover files and add them to the catalog with version control fixed.

0
Feb 10 '14 at 23:51
source share

I also had this error. But in my case, and I'm sure I will be here, I accidentally deleted main.m when I hit the delete key after the application crashed on the iPhone simulator.

After the crash, Xcode shows the main.m file, and when I hit delete, I accidentally deleted the main.m file from my project, as this is easy to do when the file name is highlighted, not the code in the detailed view.

Main.m is usually located in a group or folder with the names of the supporting files in the project file manager. I did not notice that this happened until he was able to build and run the next time, and then I had to reread the error message more carefully and see that he said that main.m was missing.

Thank you all for your contribution, but just in case, if someone in my position checks for red red files displaying the missing files and restoring them from the backup, if you have one.

0
Jun 12 '14 at 6:15
source share

Adding the missing files (red files in Xcode-> target-> Build Phases-> compiled sources) to the target folder solved the problem for me.

0
Sep 01 '14 at 6:59
source share

My problem was that in the Build Phases → Compile Sources section, I added a compiler flag for the file, but I had an error. It was assumed that:

 -fno-obj-arc 

to show that this file does not use ARC.

0
Sep 10 '14 at 2:37
source share

Maybe it will be useful for someone: I had the same error after deleting several files from the project. After the deletion fixed in the git repository, this error disappeared ...

0
Dec 25 '14 at 12:31
source share

This problem usually occurs when more than two versions of Xcode are installed, which include Swift versions for Ex. Xcode 6.4 and Xcode 7.3 have Swift 1.2 and Swift 2.0 installed. By mistake, you are trying to compile code with icorrect version for Ex. your project is in Swift 1.2 and you are trying to compile it using xcode 7.3. In this case, the drive data stores information for the fast version, but when you try to compile the code with the correct Xcode, it gives an error. To solve this problem,

  • Delete Drive Data
    but. In the Xcode selection settings

enter image description here

  1. Once the settings are open, click on the “Location” tab and click on the arrow opposite the “Drived data” path. It will open the folder with the downloaded data.

enter image description here

  1. Quit Xcode
  2. Delete all drive data.
  3. reopen the project in the correct Xcode error fixed !!!!!!
0
Aug 09 '16 at 11:05
source share

Xcode 8

@Spoek answer is correct,

But if you don’t find the file in red , find one that has a low opacity,

see this image

enter image description here

The first, but the second, there, there, pay attention, so delete it.

0
Oct 18 '16 at 17:14
source share

In my case, I will fix this:

Go to the phase assembly section and check the compilation files , check if there is a duplicate file, just save it.

0
Jan 03 '17 at 11:23
source share

This happened to me, and it took me an hour to find him. In my case, I typed too fast and did:

 [seld method]; 

instead:

 [self method]; 

Really! I do not know why it did not catch it in a more recognizable way. But he, of course, was looking for a class called "seld".

-one
Jul 29 '13 at 0:32
source share



All Articles