I have an older system (OSX 10.6.8 with xcode 4.0) and I'm trying to get OpenCV 2.3.0 to work on it. The problem that I can't resolve is that whenever I try to use the flann library, my xcode gives me a Mach-O linker error. So far I've tried recompiling the all the libraries and building the dylib from a different source, but it hasn't helped. When I check the library in terminal, i get
Freddi-2:OpenCV-2.3.0 fredchen$ file /usr/local/lib/libopencv_flann.dylib
/usr/local/lib/libopencv_flann.dylib: Mach-O 64-bit dynamically linked shared library x86_64
My specific error code is:
Undefined symbols for architecture x86_64:
"cv::flann::KDTreeIndexParams::KDTreeIndexParams(int)", referenced from:
_main in main.o
"cv::flann::SearchParams::SearchParams(int, float, bool)", referenced from:
_main in main.o
"cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&)", referenced from:
_main in main.o
"cv::BFMatcher::BFMatcher(int, bool)", referenced from:
_main in main.o
"cv::flann::IndexParams::~IndexParams()", referenced from:
cv::flann::SearchParams::~SearchParams() in main.o
"cv::flann::IndexParams::~IndexParams()", referenced from:
cv::Ptr<cv::flann::IndexParams>::delete_obj() in main.o
"vtable for cv::BFMatcher", referenced from:
cv::BFMatcher::~BFMatcher() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The dynamic libraries I have linked with the project are:
libopencv_video.2.3.0.dylib
libopencv_objdetect.2.3.0.dylib
libopencv_ml.2.3.0.dylib
libopencv_legacy.2.3.0.dylib
libopencv_gpu.2.3.0.dylib
libopencv_contrib.2.3.0.dylib
libopencv_ts.2.3.0.dylib
libopencv_imgproc.2.3.0.dylib
libopencv_highgui.2.3.0.dylib
libopencv_flann.2.3.0.dylib
libopencv_features2d.2.3.0.dylib
libopencv_core.2.3.0.dylib
libopencv_calib3d.2.3.0.dylib
I'd appreciate any help. Thanks!
I remember having similar errors when I was using 2.3.0 on Mac. You should try to stick with the latest version, either 2.4.4 or the latests from github.
Related
I have been using openears for a while now with no problems. I imported the library into my project and the application compiles and runs.
The problem arose when I tried to create and run tests. The projects refuses to compile and issues the following linkage error:
Undefined symbols for architecture x86_64:
"_delete_voice", referenced from:
_unregister_cmu_us_slt in OpenEars(cmu_us_slt.o)
"_flite_feat_set_string", referenced from:
_register_cmu_us_slt in OpenEars(cmu_us_slt.o)
"_cg_synth", referenced from:
_register_cmu_us_slt in OpenEars(cmu_us_slt.o)
"_uttfunc_val", referenced from:
_register_cmu_us_slt in OpenEars(cmu_us_slt.o)
"_flite_feat_set", referenced from:
_register_cmu_us_slt in OpenEars(cmu_us_slt.o)
"_OBJC_CLASS_$_OENotification", referenced from:
objc-class-ref in RapidEars(OEContinuousModel+RapidEars.o)
"_ps_nbest", referenced from:
l015 in RapidEars(OEContinuousModel+RapidEars.o)
"_cg_db_val", referenced from:
_register_cmu_us_slt in OpenEars(cmu_us_slt.o)
.
.
.
"_OBJC_CLASS_$_OEPocketsphinxController", referenced from:
type metadata accessor for __ObjC.OEPocketsphinxController in OpenEarsClient.o
l031 in RapidEars(OEPocketsphinxController+RapidEars.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried several approaches I found but still haven't found a solution.
Any help will be greatly appreciated.
Ok, managed to figure it out. Downloaded the latest Openears library and added it as before and it worked.
Apparently, You have to upgrade for it to work on Xcode 8.
I updated my cocoapods version to 1.0 and am now getting a slew of errors regarding architecture. This is what my errors look like:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in ReachabilityManager.o
(maybe you meant: _OBJC_CLASS_$_ReachabilityManager)
"_OBJC_CLASS_$_PBJVision", referenced from:
objc-class-ref in NewSpinViewController.o
"_PBJVisionPhotoImageKey", referenced from:
-[NewSpinViewController vision:capturedPhoto:error:] in NewSpinViewController.o
"_kReachabilityChangedNotification", referenced from:
-[NoInternetViewController viewDidLoad] in NoInternetViewController.o
"_PBJVisionPhotoThumbnailKey", referenced from:
-[NewSpinViewController vision:capturedPhoto:error:] in NewSpinViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've spent hours trying to fix this by toggling settlings under build settings but nothing is working for me.
This is what I currently have for my Architectures
Anyone have any ideas?
Try this: delete derived data and compile again. Sometimes the pod libraries simply don't get compiled even you cleaned the project, this happened to me when I updated to cocoapods 1.0.1.
I have built a cocoa framework via XCode 6.1.1, also created a universal version of the framework, then when I import the framework into a project, an compiling error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_UIResponder", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$_UIResponder", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_METACLASS_$_UIViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
"_OBJC_CLASS_$_UIViewController", referenced from:
_OBJC_CLASS_$_ViewController in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Wonder to know why?
And how to analyse the cause of the problem?
You have to add the armv7 architecture to your framework before building it.
Because the project where you use the framework in has this architecture.
You also can check the path to the framework (framework search-path)
I'm trying to using both OpenCV and Tesseract in my iPhone app.
I have no problem working with either one of them - all is compiled and linked perfectly.
But when I'm trying to work with both of them it gives me link errors:
Undefined symbols for architecture i386:
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
-[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::_OutputArray::~_OutputArray()", referenced from:
-[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::Mat::deallocate()", referenced from:
cv::Mat::release() in BTLOpenCVCameraViewController.o
"cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)", referenced from:
-[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
"cv::fastFree(void*)", referenced from:
cv::Mat::~Mat() in BTLOpenCVCameraViewController.o
"cv::Mat::copyTo(cv::_OutputArray const&) const", referenced from:
-[BTLOpenCVCameraViewController processImage:] in BTLOpenCVCameraViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm running iOS6.1, C++ Standard Library is set to: "Compiler Default"
Architecture is set to: armv7.
ANy ideas??
excuse me... I'm using xcode 4.4.1 and macbook pro 2011 early which is it's running on osx lion 64 bit...
I get these following error while compiling...
Undefined symbols for architecture i386:
"_gzclose", referenced from:
_cvReleaseFileStorage in OpenCV(persistence.o)
_cvOpenFileStorage in OpenCV(persistence.o)
"_gzeof", referenced from:
__ZL6icvEofP13CvFileStorage in OpenCV(persistence.o)
"_gzgets", referenced from:
__ZL7icvGetsP13CvFileStoragePci in OpenCV(persistence.o)
"_gzopen", referenced from:
_cvOpenFileStorage in OpenCV(persistence.o)
"_gzputs", referenced from:
__ZL7icvPutsP13CvFileStoragePKc in OpenCV(persistence.o)
"_gzrewind", referenced from:
_cvOpenFileStorage in OpenCV(persistence.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
that's happened when I declaring cv::mat .... (if i erase it.. it will compile correctly..)
anyone know how to fix this? thx..