I got some issues as below while try to build Pocket-OCR
Undefined symbols for architecture i386:
"tesseract::TessBaseAPI::SetVariable(char const*, char const*)",
referenced from:
-[OCRDisplayViewController viewDidLoad] in OCRDisplayViewController.o
"tesseract::TessBaseAPI::TesseractRect(unsigned char const*, int, int,
int, int, int, int)", referenced from:
-[OCRDisplayViewController readAndProcessImage:] in OCRDisplayViewController.o
-[OCRDisplayViewController threadedReadAndProcessImage:] in OCRDisplayViewController.o
"tesseract::TessBaseAPI::AllWordConfidences()", referenced from:
-[OCRDisplayViewController viewDidLoad] in OCRDisplayViewController.o "tesseract::TessBaseAPI::End()",
referenced from:
-[OCRDisplayViewController dealloc] in OCRDisplayViewController.o "tesseract::TessBaseAPI::Init(char
const*, char const*, tesseract::OcrEngineMode, char*, int,
GenericVector const, GenericVector const*, bool)",
referenced from:
tesseract::TessBaseAPI::Init(char const*, char const*) in OCRDisplayViewController.o "tesseract::TessBaseAPI::TessBaseAPI()",
referenced from:
-[OCRDisplayViewController viewDidLoad] in OCRDisplayViewController.o ld: symbol(s) not found for architecture
i386 clang: error: linker command failed with exit code 1 (use -v to
see invocation)
What should I do to resolve this issues?
I search on goole for answer but does'n get much help to solve the issues.
you can reference this solution on SO
I got the solution for this and also got new links and examples that are working fine and have completed my demo project
May these links are useful for others who want's to use it.
Example One
Now got the exact link from where I am able to develop my demo project.
Example Which I used
Though the answer is already accepted I found the solution that worked for me:
Apparently xCode does not add frameworks automatically to the "Link Binary With Libraries"- and "Copy Bundle Resources"-lists.
You can find them by clicking on your projectname (blue icon) and then go to "Build Phases" and add them to both lists. Then change from "Required" to "Optional". Both can be seen in the screenshot.
Related
My current project is driving me absolutely crazy
The issue is with sdk's that I have added to my project. Such as google ads, parse, Facebook and adcolony.
I added them when I first started my project weeks ago and they worked fine.
Today I opened my project, cleaned it, and I started getting "Lexical or preprocessor issues" for all of the added sdk's.
I removed them all and added them again and the "lexical or preprocessor issues" were gone but were replaced 33 "Apple Mach O Linker Errors"
I have no idea what I have done wrong as nothing has changed. I am using the latest version of all of the sdk's.
As I said the project had been building fine for weeks.
Please help me as this is driving me absolutely crazy!
Also I know that there are quite a few questions on Stack Overflow already with answers that address the mach-O linker Errors but none of them are helping me.
Here is a sample of the errors:
Undefined symbols for architecture arm64:
"std::__throw_bad_alloc()", referenced from:
std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> >::_M_insert_aux(__gnu_cxx::__normal_iterator<google_breakpadPFC_::DynamicImageRef*, std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> > >, google_breakpadPFC_::DynamicImageRef const&) in ParseCrashReporting(dynamic_images.o)
google_breakpadPFC_::DynamicImageRef* std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> >::_M_allocate_and_copy<google_breakpadPFC_::DynamicImageRef*>(unsigned long, google_breakpadPFC_::DynamicImageRef*, google_breakpadPFC_::DynamicImageRef*) in ParseCrashReporting(dynamic_images.o)
"std::string::find_first_not_of(char const*, unsigned long, unsigned long) const", referenced from:
MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o)
"std::string::substr(unsigned long, unsigned long) const", referenced from:
MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o)
"std::string::find_first_of(char const*, unsigned long, unsigned long) const", referenced from:
MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o)
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for google_breakpadPFC_::IosExceptionMinidumpGeneratorPFC_ in ParseCrashReporting(ios_exception_minidump_generator.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
I had the same problem a few years ago. It is caused by leaving "Copy items into destination's group folder (if needed)" checked when adding a framework. This option tells Xcode to copy the files you are adding into your project directory. This is good for resources such as images, sounds, and so on since it keeps your whole project in one place instead of scattered all over the computer, but if you do this with a framework you will confuse the prepeocessor and/or linkers because it messes up search paths.
I import a project cocos2dx into Xcode 5, then build it.
Undefined symbols for architecture i386:
"cocos2d::extension::CocoLoader::ReadCocoBinBuff(char*)", referenced from:
cocos2d::extension::CCDataReaderHelper::addDataFromBinaryCache(char const*, cocos2d::extension::_DataInfo*) in CCDataReaderHelper.o
cocos2d::extension::CCComRender::serialize(void*) in CCComRender.o
cocos2d::extension::GUIReader::widgetFromBinaryFile(char const*) in GUIReader.o
cocos2d::extension::SceneReader::createNodeWithSceneFile(char const*, cocos2d::extension::AttachComponentType) in SceneReader.o
"cocos2d::extension::CocoLoader::CocoLoader()", referenced from:
cocos2d::extension::CCDataReaderHelper::addDataFromBinaryCache(char const*, cocos2d::extension::_DataInfo*) in CCDataReaderHelper.o
cocos2d::extension::CCComRender::serialize(void*) in CCComRender.o
cocos2d::extension::GUIReader::widgetFromBinaryFile(char const*) in GUIReader.o
cocos2d::extension::SceneReader::createNodeWithSceneFile(char const*, cocos2d::extension::AttachComponentType) in SceneReader.o
"cocos2d::extension::CocoLoader::~CocoLoader()", referenced from:
cocos2d::extension::CCDataReaderHelper::addDataFromBinaryCache(char const*, cocos2d::extension::_DataInfo*) in CCDataReaderHelper.o
cocos2d::extension::CCComRender::serialize(void*) in CCComRender.o
cocos2d::extension::GUIReader::widgetFromBinaryFile(char const*) in GUIReader.o
cocos2d::extension::SceneReader::createNodeWithSceneFile(char const*, cocos2d::extension::AttachComponentType) in SceneReader.o
"cocos2d::extension::LabelReader::createInstance()", referenced from:
cocos2d::extension::GUIReader::GUIReader() in GUIReader.o
"cocos2d::extension::ButtonReader::createInstance()", referenced from:
cocos2d::extension::GUIReader::GUIReader() in GUIReader.o
"cocos2d::extension::LayoutReader::createInstance()", referenced from:
cocos2d::extension::GUIReader::GUIReader() in GUIReader.o
"cocos2d::extension::SliderReader::createInstance()", referenced from:
cocos2d::extension::GUIReader::GUIReader() in GUIReader.o
"cocos2d::extension::stExpCocoNode::GetChildNum()", referenced from:
I tried to remove i386 in Valid architechture, but it do not work
I don't know how to fix it. Please help
If your deployment target is 7 then change it to 6
I fixed that issue by going on the target properties of my project and in general tab there's a section called "Linked frameworks and libraries" I added here all the libraries my project uses and that's it, additionally I selected in section "Match-o type" in project properties linking section the option "Static library" also works with "Dynamic library".
I am getting this error which I try to add my OpenCV based library to a MonoTouch project:
Undefined symbols for architecture i386:
"cv::isContourConvex(cv::_InputArray const&)", referenced from:
aruco::MarkerDetector::detectRectangles(cv::Mat const&, std::vector<aruco::MarkerDetector::MarkerCandidate, std::allocator<aruco::MarkerDetector::MarkerCandidate> >&)in libAruco.a(markerdetector.o)
"cv::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)", referenced from:
aruco::MarkerDetector::warp_cylinder(cv::Mat&, cv::Mat&, cv::Size_<int>, aruco::MarkerDetector::MarkerCandidate&)in libAruco.a(markerdetector.o)
aruco::MarkerDetector::warp(cv::Mat&, cv::Mat&, cv::Size_<int>, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >)in libAruco.a(markerdetector.o)
"cv::FileNodeIterator::readRaw(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*, unsigned long)", referenced from:
cv::VecReaderProxy<float, 1>::operator()(std::vector<float, std::allocator<float> >&, unsigned long) constin libAruco.a(board.o)
"cv::FileNodeIterator::FileNodeIterator(CvFileStorage const*, CvFileNode const*, unsigned long)", referenced from:
cv::FileNode::begin() constin libAruco.a(board.o)
cv::FileNode::end() constin libAruco.a(board.o)
This is only a sample of the full list of opencv methods which are having this problem, as it is easily over 100.
I'm attempting to run this in the simulator (I only have the trial edition of monotouch). I'm compiling for the ipad simulator in xcode and have followed the Opencv tutorial as far as setting up my project with the pre-built framework from their website. I was maybe wondering if there is some linker flag I need to enter as my static library is not as large as I would expect it to be given the fact it needs to link with several of the opencv modules (that's just a gut feeling and not necessarily indicative of anything).
I suppose its also important to mention that I have very little experience with iOS and MonoTouch development, so I could have missed something really simple.
Your static library might not be a FAT (multiple architectures) library or may not include i386 code.
The easy way to find out is to try, from a terminal window:
lipo -info libAruco.a
That should return something like:
Architectures in the fat file: libAruco.a are: i386 ...
where ... is likely armv7 (or more) to support the iOS devices.
OTOH if i386 is missing then it means your library is not compiled to work on the simulator. In such case you'll need to return to Xcode to build this architecture and use lipo to create a FAT library (that includes both the arm and i386 architectures).
Need to generate QR code from iOS for different strings. Tried out the following library:
**jverkoey-ObjQREncoder-e1841fe**
being able to generate QR Code .. but this code cannot be read by any readers.
**iOS-QR-Code-Generator**
Following the documentation provided But facing linking problem when i am trying to add the 'kuapay-iOS-QR-Code-Generator' to generate QRCode. I followed the way that is written in the github project
"To build your own project from this template you must attace the libz.dylib library to your target in Xcode. You must also drag the QRDraw and libpng folder files into your project. Update the Header Search path to look in the libpng folder in your target build settings menu."
But it give me 6 error message. These are -
Undefined symbols for architecture i386:
"CQR_Encode::EncodeData(int, int, bool, int, char*, int)", referenced from:
-[RootViewController LoadQRImage] in RootViewController.o
"CQR_Encode::~CQR_Encode()", referenced from:
-[RootViewController LoadQRImage] in RootViewController.o
"_OBJC_CLASS_$_FileManager", referenced from:
objc-class-ref in RootViewController.o
"QRDrawPNG::draw(char*, int, int, unsigned char (*) [177], void*)", referenced from:
-[RootViewController LoadQRImage] in RootViewController.o
"CQR_Encode::CQR_Encode()", referenced from:
-[RootViewController LoadQRImage] in RootViewController.o
"vtable for QRDrawPNG", referenced from:
QRDrawPNG::QRDrawPNG() in RootViewController.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone help me with this? OR suggest a better QRcode generator for iOS device?
Thanks a lot!
This issue is caused because you are using c++ code silently in your app , use .mm instead of .m in your RootViewController .
Check you have the file Barcode.mm, qr_draw_png.mm, QR_Encode.mm linked to your project target. Also you may be add "-fno-objc-arc" flag.
I'm trying to link OpenCV in my iPhone project. I upgraded project made on Xcode3.x for latest Xcode. So I need to link opencv built on Xcode 4.3.
I followed the guide in http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en.
But I meet the link error like below.
Undefined symbols for architecture i386:
"_dgesdd_", referenced from:
cv::_SVDcompute(cv::Mat const&, cv::Mat&, cv::Mat*, cv::Mat*, int) in libopencv_core.a(lapack.o)
"_sgesdd_", referenced from:
cv::_SVDcompute(cv::Mat const&, cv::Mat&, cv::Mat*, cv::Mat*, int) in libopencv_core.a(lapack.o)
"_dpotrf_", referenced from:
cv::solve(cv::Mat const&, cv::Mat const&, cv::Mat&, int) in libopencv_core.a(lapack.o)
cv::invert(cv::Mat const&, cv::Mat&, int) in libopencv_core.a(lapack.o)
......
I wonder I never configured i386 architecture. Please tell me how I can fix this issue.
Oh, I found that I missed Accelerate.framework in Build Phase.
You can add framework in [Project]->[Build Phases]->[Link Binary With Libraries].