Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Errors using OpenCV with opencv_contrib on Xcode

Brian Scherady:

For my application running on iPhone I am using OpenCV using opencv2.framework in Xcode with objective-c and C++ as languages. My development worked well until I wanted to introduce cv::Tracker that is not included in opencv2.framework but part of opencv_contrib.

  1. I rebuilt and installed from the source opencv-3.4.0 with opencv_contrib-master using CMake and terminal commands make and install.

  2. In Xcode I have set HEADER_SEARCH_PATHS = /usr/local/include and LIBRARY_SEARCH_PATHS = /usr/local/lib

When compiling I get a long list of errors of the style:


Undefined symbols for architecture x86_64:
"cv::error(int, cv::String const&, char const*, char const*, int)",
referenced from:
cv::Mat::Mat(int, int, int, void*, unsigned long) in OpenCVRenderer.o
"cv::Mat::operator=(cv::Scalar_ const&)", referenced from:
cv::Mat::Mat(int, int, int, cv::Scalar_ const&) in
OpenCVRenderer.o
cv::Mat::Mat(cv::Size_, int, cv::Scalar_ const&) in
OpenCVRenderer.o
"cv::Mat::deallocate()", referenced from:
cv::Mat::release() in OpenCVRenderer.o
"cv::polylines(cv::_InputOutputArray const&, cv::_InputArray const&,
bool, cv::Scalar_ const&, int, int, int)", referenced from:
.
.
.

I set OTHER_LDFLAGS = (list of opencv dylibs) preceeded by a "-" sign

Now I get errors as if the libraries are not found while there are in fact in /usr/local/lib

For example I get:


ld: library not found for -libopencv_core.3.4.0.dylib
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Any help? Thank you.



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Errors using OpenCV with opencv_contrib on Xcode

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×