当前位置:   article > 正文

c++下opencv报错:undefined reference to`cv::fastFree(void*)'/tmp/cc9yZhef.o:In function`cv::Mat::release_main.cpp:(.text._zn2cv3mat7releaseev[_zn2cv3mat7re

main.cpp:(.text._zn2cv3mat7releaseev[_zn2cv3mat7releaseev]+0x4b): undefined

错误信息:

/tmp/cc9yZhef.o: In function `cv::Mat::~Mat()':

main.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)'
/tmp/cc9yZhef.o: In function `cv::Mat::release()':
main.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()'

collect2: error: ld returned 1 exit status

排查错误:

# g++ main.cpp `pkg-config opencv --libs --cflags opencv`

出现

Package opencv was not found in the pkg-config search path.

Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
Package opencv was not found in the pkg-config search path.
Perhaps you should add the dir

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/300491
推荐阅读
相关标签
  

闽ICP备14008679号