Compile error : undefined reference to‘__atomic_fetch_add_4’

前端 未结 3 414
广开言路
广开言路 2021-01-19 14:52
#include 
using namespace cv;

int main()
{
  Mat img=imread(\"cornea.jpg\");
  imshow(\"src\",img);
  waitKey(0);
  return 0;
}

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 15:29

    You seem to be mixing Debug and Release versions of the OpenCV libraries. https://github.com/Itseez/opencv/issues/5581 You should only include and link against the normal Release library, or againt a Debug library you built yourself.

    In your case, this may come from the double include -cflags -I /usr/local/include/opencv. I would try remove all the manual paths and just write pkg-config --cflags --libs opencv (to the packaged Release version).

    Note that /usr/local/include is a standard include path and will always be searched. You could try to exclude standard paths with -nostdinc https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

    Another option is to uninstall one of the two versions, or remove one version away from the standard paths.

提交回复
热议问题