if it happened when you include opencv header.
I would recommand that change the order of headers.
put the opencv headers just below the standard C++ header.
like this:
#include<iostream>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>