ld: library not found for -lopencv_imgproc error - objective-c

While building my project, I am getting this error.
ld: library not found for -lopencv_imgproc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What kind of library it is.? Can somebody explain.

Hello friend there are a lot of reason of linkers error. Some basic reason:
1. You can remove linker error goto Build Setting>Build Active Architecture Only set to No for Target and Project both.
2. Sometimes unnecessary .a files created Target>General. Delete irrelevant .a files.
3. Delete all library paths from Build Setting>Search Paths(o top) which you are not using like AFNetworking then pls delete -lAFNetworking path.
Try this if still you got the error show me the screenshot.
Thanks

Related

Duplicate symbol _OBJC_CLASS_$_Facebook

I'm building an ARC iphone app, and about to integrate the addThis ios library.
I get the following error:
ld: duplicate symbol _OBJC_CLASS_$_Facebook in /Users/mars/Desktop/Pst/trunk/Pst/ThirdPartyLibs/FBConnect/FacebookSDK/FacebookSDK.framework/FacebookSDK(Facebook.o) and /Users/mars/Library/Developer/Xcode/DerivedData/Pst-bqmphjiqldalzsankfvxugsurcdj/Build/Intermediates/Pst.build/Debug-iphonesimulator/Pst.build/Objects-normal/i386/Facebook.o for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've double checked with my Compile Resource, and only 1 facebook.m is present.
I've also put "-fno-objc-arc" in my compiler flags for those library files because they are built without ARC
Any help would be really appreciated!!
I've got the same error when followed the instruction to drag ThirdPartyLibs to my project. It had added both FBConnect and FacebookSDK to my project.
If you open the AddThisDemo project, which comes with the library, you will see that only FacebookSDK and DeprecatedHeaders were added (not entire FBConnect). I have recreated this structure in my project and that had solved my issue.
Hope that helps!
For anyone with this issue but these answers are not helping: if you created one custom class and called it Facebook.h/.m, just change its name and after it, no more linkage errors.
You have a #import "facebook.m" in one of your files where you should have put #import "facebook.h".

Trouble when I try to run Archive command in XCode

I'm making an app with Facebook validation. It is working fine on simulator and in the device.
But, when I try to "Archive" (Product => Archive), I get this error:
ld: library not found for -lfacebook_ios_sdk
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The libraries are okay, otherwise it would not compile on simulator/device.
I don't know if this information is relevant, but my project is an ARC project.
Does anyone know what this error could mean?
I solved the problem by just removing the "libfacebook_ios_sdk.a" reference from my Link Binary Libraries and adding it again.
I dont know why it worked, but worked!

TouchJSON Fails on Compile (link error)

Undefined symbols for architecture x86_64:
"_objc_unretainedPointer", referenced from:
-[CJSONScanner scanJSONStringConstant:error:] in CJSONScanner.o
-[CJSONSerializer serializeNumber:error:] in CJSONSerializer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hey all. Trying to use TouchJSON to do some JSON-y stuff. I followed the read me for the library to the meter I think, but every time I try to compile I get this error. I don't know much about Xcode (I've only been learning Obj-C recently) so I'm clueless about this. Any ideas?
Try to remove "Experimental" folder (and files inside, of course).
README
Be aware that the code in the Experimental subdirectory of Source is
just that and may not have been extensively tested and/or have extra
dependencies
So it could be a problem about extra dependencies (but always make sure if your project already have linked all dependency libraries/framework)

RKJSONParserJSONKit not found

I'm trying to use JSON parsing from RestKit, but I'm receiving
the following compile time error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_RKJSONParserJSONKit", referenced from:
objc-class-ref in FloorMapLoaderViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
RestKit works ok, this being the only error I've seen so far.
This is my import line:
#import <RestKit/Support/JSON/JSONKit/RKJSONParserJSONKit.h>
edit:
oddly, it fails to compile only if I try to create a parser like so:
RKJSONParserJSONKit *parser = [RKJSONParserJSONKit new];
Commenting out this line allows for compilation, but I do need to instance a parser.
How can I fix this error?
Thank you.
Importing means that your source code can see the API, so the IDE knows how to auto-complete and so that the compiler knows how to generate the right object code.
You have a linker error. Once your own code is compiled, it has to all be bundled together with all the code it is dependent on (not counting dynamically linked system libraries). Your linker is telling you that after bundled everything it can find together, not all of it is there.
What you need to do is go to the target you are building, select the Build Phases tab, and add the necessary library to the "Link Binary With Libraries" section.

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

My XCode version is 4.2 for iOS 5.0. I choose "LLVM GCC 4.2" as the compiler. When I compile my project, it show me the following error:
ld: warning: directory not found for option '-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc/arm-apple-darwin10/4.0.1'
ld: warning: directory not found for option '-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc/arm-apple-darwin10/4.2.1'
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
Please help me figure out why this is happening and how to fix it.
The libz.1.2.3 library does not exist anymore (or at least is not included in the SDK). In your project settings, link with a newer version of the library like libz.1.2.5.