linking error during compiling - ios

I got this error:
"Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NKLocalJSONParser", referenced from: objc-class-ref in
BBCNepaliNews.o ld: symbol(s) not found for architecture i386 clang:
error: linker command failed with exit code 1 (use -v to see invocation) "
How can I solve this?

Try shift + command + k and then try building it again. This will clean your build. Alternatively, if this is an open api, make sure that when you imported the files into your project that you made sure to set the target as your project and that you copied them in rather than just putting references to them.

Related

Undefined symbols for architecture x86_64 when using Tesseract

I am using tesseract provided by google. After following this tutorial, i finally built finish my app. However, when i run it, i run into the problem of undefined symbols. This is the error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_G8Tesseract", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do i fix this issue? I tried searching online but none of the solutions worked for me. I tried reinstalling the pods and updating it. Then i faced this error
clang: error: no such file or directory: '/Users/admin/Desktop/tst/Pods/Target Support Files/Pods-tst/Pods-tst-dummy.m'
clang: error: no input files
When i tried redoing the project i get his error
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_G8Tesseract", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Apparently i had to add the TesseractOCR.framework separately even after using cocoa pods and disable Bitcode. This prevented the errors.
I think you should update pod version:
sudo gem install cocoapods
After this run:
pod update --verbose
Since Tesseract requires libstdc++.6.0.9.dylib (or libstdc++.6.0.9.tbd if libstdc++.6.0.9.dylib is unavailable in your current Xcode version) and CoreImage.framework you’ll need to link both of these libraries in.
In the General tab, scroll down to Linked Frameworks and Libraries.
There should be only one file here: TesseractOCR.framework, which you just added. Click the + button underneath the list. Find both libstdc++.dylib (or libstdc++.6.0.9.tbd) and CoreImage.framework and add them to your project.

cocoapods linker error when i added it to my project

i'm using cocoapods for the first time and after everything goes well
i get to run my project that was always wor˚ and got those 2 errors in lin˚er
can anyone please tell me what is it
than˚s
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_PECropViewController", referenced from:
objc-class-ref in addProductViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The addProductViewController object is not found and it was referenced within AppDelegate. You do not link addProductViewController into your app. Check if your Compile Sources section within the Build Phases of your project shows addProductViewController.m
than˚s every body for your help
the problem was with arm 64 i just added it in my target and everything work fine
in architectures filed add standard architectures armv7,arm64

Crash when using lib file in proj

I have followed this tutorial LINK
but i get a linker error when i added the lib and its .h to the project.
i searched google and i found that -ObjC and -all_load should be addd in setting i did it but the error couldn't be solved.The error is as follows:
ld: warning: ignoring file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/techvedika/Desktop/RND/MathTest/MathTest/iCodeBlogsMathLibrary/libICodeMathUtils.a (3 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
how do i solve this?
Can you please check lipo -info libICodeMathUtils.a on terminal. If it is not listing architecture i386 that means your library is not build for simulator. And it will not work on simulator
obviously, this is not a crash , it's just a link error, your project lack of i386 version libICodeMathUtils.a, so you should first add libICodeMathUtils.a to your project.
The MathFunctions class is missing. Either from your application project or from the SimpleLibrary.a that you use. Make sure it is part of the compilation and linking steps of your build.

"_OBJC_CLASS_$_FBSBJSON", referenced from:

i have a try to run the application and application give me this error
if anyone know that then please provide solution
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBSBJSON", referenced from:
objc-class-ref in AppController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are some possible things due to which this error may come:
while adding the SBJSON you might not be checked that copy option .
or go to compiled sources and see your .m file is specified there or not .

Linking Error iOS

I have these weird linking errors in iOS. Can someone explain them and how to fix them? Thanks!
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Parser", referenced from:
objc-class-ref in MasterViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go to the project navigator: CMD + 1
Select the file "Parser.m" (or the file that contains the class Parser)
Show the File Inspector: OPT + CMD+ 1
Scroll down to Target Membership
Ensure the box is ticked for the target you are building for.

Resources