Error when linking libopencv_gpu.dylib

asked 2015-03-21 10:31:16 -0500

maundermax gravatar image

Hi,

I'm trying to compile opencv 2.4.10 on my Macbook Pro. The compiler I am using is clang v5.1. When it's trying to link the objects in the opencv_gpu directory to create a shared library, I get errors about undefined symbols. The first one is that it couldn't find cv::FileStorage::FileStorage, which is referenced in cascadeclassifier.cpp. This is strange since the cascadeclassifier.cpp source code does using namespace cv; and simply references FileStorage without the 'cv::' prefix. The linker somehow thinks it should look for cv::FileStorage::FileStorage instead of just cv::FileStorage.

How should I fix this? Thanks in advance.


Linking CXX shared library ../../lib/libopencv_gpu.dylib Undefined symbols for architecture x86_64: "cv::FileStorage::FileStorage(std::string const&, int, std::string const&)", referenced from: cv::gpu::CascadeClassifier_GPU::load(std::string const&) in cascadeclassifier.cpp.o cv::gpu::CascadeClassifier_GPU::LbpCascade::read(std::string const&) in cascadeclassifier.cpp.o "cv::AlgorithmInfo::addParam(cv::Algorithm&, char const, double&, bool, double (cv::Algorithm::)(), void (cv::Algorithm::)(double), std::string const&)", referenced from: (anonymous namespace)::GHT_Guil_Full::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosRotation::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_Pos::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosScale::info() const in generalized_hough.cpp.o (anonymous namespace)::CLAHE_Impl::info() const in imgproc.cpp.o "cv::AlgorithmInfo::addParam(cv::Algorithm&, char const, int&, bool, int (cv::Algorithm::)(), void (cv::Algorithm::)(int), std::string const&)", referenced from: (anonymous namespace)::GHT_Guil_Full::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosRotation::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_Pos::info() const in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosScale::info() const in generalized_hough.cpp.o (anonymous namespace)::CLAHE_Impl::info() const in imgproc.cpp.o "cv::AlgorithmInfo::AlgorithmInfo(std::string const&, cv::Algorithm* ()())", referenced from: (anonymous namespace)::GHT_Ballard_Pos_info() in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosScale_info() in generalized_hough.cpp.o (anonymous namespace)::GHT_Ballard_PosRotation_info() in generalized_hough.cpp.o (anonymous namespace)::GHT_Guil_Full_info() in generalized_hough.cpp.o (anonymous namespace)::CLAHE_Impl_info() in imgproc.cpp.o "cv::groupRectangles(std::vector<cv::rect_<int>, std::allocator<cv::rect_<int> > >&, std::vector<int, std::allocator<int=""> >&, int, double)", referenced from: groupRectangles(std::vector<ncvrect32u, std::allocator<ncvrect32u=""> >&, int, double, std::vector<unsigned int,="" std::allocator<unsigned="" int=""> >) in cascadeclassifier.cpp.o "cv::groupRectangles(std::vector<cv::rect_<int>, std::allocator<cv::rect_<int> > >&, int, double)", referenced from: groupRectangles(std::vector<ncvrect32u, std::allocator<ncvrect32u=""> >&, int, double, std::vector<unsigned int,="" std::allocator<unsigned="" int=""> >) in cascadeclassifier.cpp.o cv::gpu::HOGDescriptor::computeConfidenceMultiScale(cv::gpu::GpuMat const&, std::vector<cv::rect_<int>, std::allocator<cv::rect_<int> > >&, double, cv::Size_<int>, cv::Size_<int>, std::vector<cv::gpu::hogconfidence, std::allocator<cv::gpu::hogconfidence=""> >&, int) in hog.cpp.o cv::gpu::HOGDescriptor::detectMultiScale(cv::gpu::GpuMat const&, std::vector<cv::rect_<int>, std::allocator<cv::rect_<int> > >&, double, cv::Size_<int>, cv::Size_<int>, double, int) in hog.cpp.o "cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)", referenced from ...

(more)
edit retag flag offensive close merge delete

Comments

Im getting this error as well. Any luck?

jmerkow gravatar imagejmerkow ( 2015-05-07 21:56:20 -0500 )edit