请教一下使用opencv使用arm-linux-gnueabihf-g++-4.8编译后的库编写的代码出错的问题
我用opencv2.4.13中自带的platforms/linux/arm-gnueabi.toolchain.cmake文件编译好的库,再使用arm-linux-gnueabihf-g++-4.8编译代码的时候后会出错。
编译命令arm-linux-gnueabihf-g++-4.8 -L/usr/local/opencv-arm/lib -I/usr/local/opencv-arm/include -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 -lrt -lpthread -lm -ldl -o test DisplayImage.cpp(为了防止少某些库,我就全加上了)
错误信息:
/tmp/cc8j2z1H.o: In function `main':
DisplayImage.cpp:(.text+0x7e): undefined reference to `cv::imread(std::string const&, int)'
DisplayImage.cpp:(.text+0x114): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
DisplayImage.cpp:(.text+0x12a): undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/tmp/cc8j2z1H.o: In function `cv::Mat::~Mat()':
DisplayImage.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x20): undefined reference to `cv::fastFree(void*)'
/tmp/cc8j2z1H.o: In function `cv::Mat::release()':
DisplayImage.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x30): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
游牧有妞比的大神知道为什么阿