#include
using namespace cv;
int main()
{
Mat img=imread(\"cornea.jpg\");
imshow(\"src\",img);
waitKey(0);
return 0;
}
You may need to link with atomic library. Try with
-latomic
in your GCC compilation command line.
NOTE: i had to do it compiling with CLang 8 on a ARMv7 device (Android).
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.
On i386, you need to add -latomic
as GCC cannot use assembler instructions but has to fallback on the libatomic library implementation.
Starting with i586, atomic instructions are available and linking against libatomic is no longer required. That means, the alternative of -latomic
is to use -march=i586
.