Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linker command failed with exit code 1 error in Xcode project

I was working on my project and suddenly after editing the code and compiling gave this error:

ld: warning: directory not found for option '-
L/Users/mani/Documents/Classes/Twitter+OAuth/Libraries & Headers' ld: duplicate symbol _OBJC_CLASS_$_playSiew in /Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/playSiew.o and /Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/Thumb.o for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I never touched the project settings, just edited the code.

What's more strange is that I took out last revised code from svn but still I got the the same error.

like image 615
user1374408 Avatar asked May 30 '12 06:05

user1374408


People also ask

What does linker command failed with exit code 1?

This means you have two files which have a function called "main" in them -- the compiler compiles all the code fine, but when it goes to link, it sees two object symbols that have the same name.

How do I fix clang error linker command failed with exit code 1?

My iOS builds fail with "clang: error: linker command failed with exit code 1" Clang! The error could be caused by App Center building with the xcodeproj instead of the workspace. When adding CocoaPods to your project, you must switch to using the workspace when building in App Center.


1 Answers

You may be accidentally #import'ing a .m file instead of a .h. Use Cmd+Shift+F and search for ".m" (without quotes). It will most likely lie in one of the classes mentioned in the warning. If not, clean and run again.

like image 64
CodaFi Avatar answered Sep 19 '22 08:09

CodaFi