Build Static openCV 4 lib in MacOS
Hi all,
Following the guideline https://www.learnopencv.com/install-o..., In MacOS Mojave, I have successfully built C++ OpenCV4 dynamic libs from github source. I tried to run a simple program (which is shown below) and it worked well
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
int main(void)
{
std::cout << cv::getBuildInformation() << std::endl;
}
Then, I tried to build C++ static lib and it was successful too (I turn off CMAKE option BUILD_SHARED_LIBS). However, when I run the same code above, I got the following errors. Could somebody please help me? I would like to use static libs rather than dynamic libs.
Undefined symbols for architecture x86_64: "___itt_api_version_ptr__3_0", referenced from: cv::utils::trace::details::Region::LocationExtraData::LocationExtraData(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::LocationExtraData::LocationExtraData(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::LocationExtraData::init(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::Impl(cv::utils::trace::details::TraceManagerThreadLocal&, cv::utils::trace::details::Region, cv::utils::trace::details::Region&, cv::utils::trace::details::Region::LocationStaticStorage const&, long long) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::registerRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::enterRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::leaveRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) ... "___itt_domain_create_ptr__3_0", referenced from: cv::utils::trace::details::Region::LocationExtraData::LocationExtraData(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::LocationExtraData::LocationExtraData(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::LocationExtraData::init(cv::utils::trace::details::Region::LocationStaticStorage const&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::Impl(cv::utils::trace::details::TraceManagerThreadLocal&, cv::utils::trace::details::Region, cv::utils::trace::details::Region&, cv::utils::trace::details::Region::LocationStaticStorage const&, long long) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::registerRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::enterRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::leaveRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) ... "___itt_id_create_ptr__3_0", referenced from: cv::utils::trace::details::Region::Impl::Impl(cv::utils::trace::details::TraceManagerThreadLocal&, cv::utils::trace::details::Region, cv::utils::trace::details::Region&, cv::utils::trace::details::Region::LocationStaticStorage const&, long long) in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl::registerRegion(cv::utils::trace::details::TraceManagerThreadLocal&) in libopencv_core.a(trace.cpp.o) "___itt_id_destroy_ptr__3_0", referenced from: cv::utils::trace::details::Region::Impl::~Impl() in libopencv_core.a(trace.cpp.o) cv::utils::trace::details::Region::Impl ...