OpenCV - Gtkmm conflict?

asked 2013-04-25 10:25:18 -0500


I would use the OpenCV libraries into a program using the Gtkmm interface but when I try to open an image with cv::imread, there is an error message during the execution : gtk-error ** Using gtk+ 2.x and gtk+ 3 in the same process is not supported.

I know that this is a gtk error, but it is caused by the imread instruction.

Does anyone have heard about this kind of conflict?

I am using gtkmm 3.0 and have upgraded opencv to 2.4.5 but this did not solve the problem. The operating system is Ubuntu 12.04.

Thnak you in advance.

edit retag flag offensive close merge delete


As far as I know OpenCV doesn't use any gtk. Probably your program debugger is not showing you the correct place of the error. As you mentioned yourself, I do not think this is the correct forum for your question...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-26 03:58:14 -0500 )edit

I have image manipulation programs, using opencvs, which could be useful for colleagues. But they are used to use programs with graphical interface. If I give them a console and three lines of code, file names and parameter, they might be sceptical. Thus the idea to try to develop those program into a graphical environment. gtkmm is “just” for the interface. The problem is that the mere fact of opening an image with opencv create the mentioned error message from the gtkmm end. I supposed that I am not the only one to have used those libraries together. But I have only seen one post on this conflict and the solution was to upgrade opencv, which I did, with no success.

Vincent66 gravatar imageVincent66 ( 2013-04-26 04:28:59 -0500 )edit

For graphical purposes, openCV works perfectly with Qt for linux/windows or you can even use winforms on windows platforms. Done both without problems for graphical interfacing.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-26 06:02:51 -0500 )edit

I will continue it dig a bit with gtkmm but if I have no luck, I will follow your advice. Thank you.

Vincent66 gravatar imageVincent66 ( 2013-04-26 07:57:11 -0500 )edit

Well, you have to downgrade your gtkmm3.0 to gtkmm2.x I prefer gtkmm2.4 this is done by removing libgtkmm-3-dev and installing libgtkmm-2.4-dev

eng.eslam gravatar imageeng.eslam ( 2015-02-05 01:09:57 -0500 )edit