I am facing this error, what will be poosible reason for that error
ld: library not found for -lOAuth
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
thanks for any help.
if you are using twitter+oAuth then you need to drag libOAuth.a lib in your project you are missing that.
you can find libOAuth.a in your sample code folder
This Error occur when you use two file's with the same name, or you use, two same name of variable into two different .m files. So check that out.
When you miss one or more file, you will get this error. Check out for that missing file.
Related
Can someone tell me why I am getting this error. I have tried cleaning and building several times . But still I am getting this error.
duplicate symbol _main in:
/Users/outthinkingindiapvtltd/Library/Developer/Xcode/DerivedData/PatternTest- axdlojadtjwkbvdioeiumrzlovix/Build/Intermediates/PatternTest.build/Debug-iphoneos/PatternTest.build/Objects-normal/armv7/main-EC3660AC7D58737D.o
/Users/outthinkingindiapvtltd/Library/Developer/Xcode/DerivedData/PatternTest-axdlojadtjwkbvdioeiumrzlovix/Build/Intermediates/PatternTest.build/Debug-iphoneos/PatternTest.build/Objects-normal/armv7/main-6C8789F4078B135A.o
ld: 1 duplicate symbol for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This means, you have a file twice in your Xcode Project. Check the Project folder, You will find a file in two different groups or folders with the same name.
It seems you have multiple entries under Targets/Compiled Sources. removed them and the problem is solved.
It might be possible you have imported an .m file instead of .h, like:
#import "DemoView.m"
Just check the extensions of the file you recently imported, after which you are getting this error.
I am trying to integrate tesseract into my application. When I runs My application it's showing the bellow. If I remove tesseract file, the application is fine without errors. What might be the problem?
Error displayed is:
ld: duplicate symbol _main in /Lutful Kabir/Project/Business Card Reader/DBZiCardReader/DBZiCardReader/build_dependencies/dependencies/lib/libtesseract_all.a(svpaint.o) and /Users/foyzulkarim/Library/Developer/Xcode/DerivedData/DBZiCardReader-awawphfeoprlwqgcmoohhievukcx/Build/Intermediates/DBZiCardReader.build/Debug-iphonesimulator/DBZiCardReader.build/Objects-normal/i386/main.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
How can i remove this error message?
clang has found 2 _main symbols.
one in svpaint.o inside of libtesseract_all.a
one in your main.m file
libtesseract is either expects you to have a project that relies on their main in svpaint.o (and perhaps there are some instructions to this effect), or that it expects you not to import anything that will cause svpaint.o to have to be included as a part of the link (perhaps you are importing a libtesseract header like svpaint.h … or importing something which imports it … and which is meant only as one of their examples for using their library …)
This may be a simple problem.
But im totally stuck with this error.
I integrated three 20 into my project.
I integrated the Sharekit also into the project and three20.
But whenever i compile the following error is showing.i can't figure this error.
Can anyone please help me this.Thanks in advace.
Error:
ld: duplicate symbol _OBJC_METACLASS_$_SHKDelicious in /Users/icodingmacmini3/Library/Developer/Xcode/DerivedData/Awesome-gqlhzchmnubhcbetpcfvbiccpdzu/Build/Products/Debug-iphoneos/libThree20UI.a(SHKDelicious.o) and /Users/icodingmacmini3/Library/Developer/Xcode/DerivedData/Awesome-gqlhzchmnubhcbetpcfvbiccpdzu/Build/Intermediates/Awesome.build/Debug-iphoneos/Awesome.build/Objects-normal/armv7/SHKDelicious.o for architecture armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
When ever you get a duplicate symbol check for imports. Some kind of cycle would have happened. Try importing in .m file rather than .h file it may solve the problem.
Also make sure you have not added the file twice.
This is a linkage error. The meaning of this error is that , you have used the symbol SHKDelicious twice. Check the links below
duplicate symbol _OBJC_METACLASS_$_ClassName
http://www.dizzey.com/development/ios/duplicate-symbols-when-linking-objectivec-static-libraries/
http://www.mac-forums.com/forums/os-x-development-darwin/171821-duplicate-symbol-_objc_metaclass_.html
Hello
I am trying to install json framework. According to installation instructions I have to copy all the classes from json-framwork/classes in my project! I did that and I am getting this error:
ld: duplicate symbol
_OBJC_METACLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-4254E5B76E32172.o
and
/Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-46310C881BFA9776.o
for architecture i386 collect2: ld
returned 1 exit status Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
failed with exit code 1
What I am doing wrong here?
Please have a look at:
iPhone: Duplicate Symbol Error?
Select the project navigator in the right sidebar. Double click your project(top element).
Now open the build phases tab. There is a section which is called Compile Sources. Open it an check if there is a duplice entry of the file which the error refers to.
My Installation of the json-framework
Just added these files to my project
Each .m file is here only once
In the class I need JSON parsing I'll just import:
#import "JSON.h"
I just erase the .m and .h files from JSON Framework wich the compilator was giving me errors, at the end I just keep from the JSON Framework: NSObject+SBJSON, NSSTring+SBJSON .h and m.
This worked for me, I hope it helps :D
From what I have read this is supposed to be when the linker (not exactly sure how that works) can't find a symbol. the symbol in question is: SCNetworkReachabilityCreateWithAddress as can be seen from the full error message below.
the thing is that the correct
framework is added to my target.
xcode recognises the symbol OK, i.e.
there is no error message in the .m
file.
the .m file is added to the correct
target so I'm not at all sure what to
do.
Any ideas please?
"SCNetworkReachabilityCreateWithAddress", referenced from:
-[AppWelcomeVC viewDidLoad] in AppWelcomeVC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Do you have #import <Availability.h> in your AppWelcomeVC class header, or added to your precompiled header (MyApp_Prefix.pch)?
What frameworks do you have in your project?
In the past when I've had this error removing the framework and readding it fixed the problem.
Permissions problems with the framework file itself can also cause this error.