haven’t you caught the cv::Exception? why mess around with the debugger before you even know the exception’s contents? it’s C++, it can do that.
in general, OpenCV people don’t concern themselves much with operating systems or desktop environments. those things are supposed to work and to get out of the way.
on unixy platforms that aren’t apple, it needs GTK or Qt, yes. what did you expect? it talking to an X server directly?