kyamagu / mexopencv

Collection and a development kit of matlab mex functions for OpenCV library
http://kyamagu.github.io/mexopencv
Other
661 stars 319 forks source link

Make Problem about opencv 2.4.13 #392

Closed fybaft2012 closed 6 years ago

fybaft2012 commented 6 years ago

Hi kyamagu, I have already installed OpenCV 2.4.13 on my Ubuntu 16.04. When I run make in terminal, it gives the errors.

~/Downloads/mexopencv-2.4$ make MATLABDIR=/usr/local/MATLABT/R2017b
/usr/local/MATLABT/R2017b/bin/mex -cxx -largeArrayDims -Iinclude -I/usr/local/include/opencv -I/usr/local/include src/+cv/FileStorage.cpp -lMxArray -Llib -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -L/usr/local/cuda-8.0/lib64 -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lcufft -lnpps -lnppi -lnppc -lcudart -latomic -ltbb -lGL -lGLU -lrt -lpthread -lm -ldl   -output +cv/FileStorage
Building with 'g++'.
/tmp/mex_9937959801428870_14537/FileStorage.o: In function `(anonymous namespace)::read(cv::FileStorage&, MxArray&, cv::FileNode const&)':
FileStorage.cpp:(.text+0xce1): undefined reference to `cv::FileNode::name() const'
FileStorage.cpp:(.text+0xdf9): undefined reference to `cv::FileNode::name() const'
FileStorage.cpp:(.text+0xfbc): undefined reference to `cv::FileNode::name() const'
FileStorage.cpp:(.text+0x1185): undefined reference to `cv::FileNode::name() const'
FileStorage.cpp:(.text+0x1463): undefined reference to `cv::FileNode::name() const'
/tmp/mex_9937959801428870_14537/FileStorage.o:FileStorage.cpp:(.text+0x17e6): more undefined references to `cv::FileNode::name() const' follow
/tmp/mex_9937959801428870_14537/FileStorage.o: In function `(anonymous namespace)::write(cv::FileStorage&, MxArray const&, bool)':
FileStorage.cpp:(.text+0x2fe6): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
FileStorage.cpp:(.text+0x30c6): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
FileStorage.cpp:(.text+0x315d): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
FileStorage.cpp:(.text+0x31c0): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
FileStorage.cpp:(.text+0x326f): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/mex_9937959801428870_14537/FileStorage.o:FileStorage.cpp:(.text+0x3396): more undefined references to `cv::operator<<(cv::FileStorage&, std::string const&)' follow
/tmp/mex_9937959801428870_14537/FileStorage.o: In function `(anonymous namespace)::write(cv::FileStorage&, MxArray const&, bool)':
FileStorage.cpp:(.text+0x3643): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
FileStorage.cpp:(.text+0x3742): undefined reference to `cv::write(cv::FileStorage&, std::string const&, double)'
FileStorage.cpp:(.text+0x385a): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
FileStorage.cpp:(.text+0x394d): undefined reference to `cv::write(cv::FileStorage&, std::string const&, int)'
FileStorage.cpp:(.text+0x3a62): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
FileStorage.cpp:(.text+0x3b4e): undefined reference to `cv::write(cv::FileStorage&, std::string const&, cv::Mat const&)'
/tmp/mex_9937959801428870_14537/FileStorage.o: In function `mexFunction':
FileStorage.cpp:(.text+0x3dee): undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)'
FileStorage.cpp:(.text+0x3f9e): undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)'
FileStorage.cpp:(.text+0x4058): undefined reference to `cv::FileStorage::getDefaultObjectName(std::string const&)'
collect2: error: ld returned 1 exit status

Makefile:37: recipe for target '+cv/FileStorage.mexa64' failed
make: *** [+cv/FileStorage.mexa64] Error 255

Could you please help me why it happened and how to solve it?