fastfusion icon indicating copy to clipboard operation
fastfusion copied to clipboard

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Open tashianasir opened this issue 7 years ago • 19 comments

Hi, I am using fastfusion on Ubuntu 16.04, and when i run fastfusion after building, I get the following error:

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

I cannot delete either of the two because both are needed by basic OS applications. Is fastfusion direcly importing GTK libraries, or could it be OpenCV importing symbols from both GTK versions? Any hints how I can get pass it will be greatly appreciated.

Thanks.

tashianasir avatar Nov 25 '17 21:11 tashianasir

Please note that "ldd" shows only gtk3, I am unable to understand how gtk2 symbols are being used by the program.

`~/fastfusion $ ldd -d bin/onlinefusion | grep gtk

libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f51ee529000)

`

tashianasir avatar Nov 26 '17 01:11 tashianasir

Hi, I am facing the same problem. Does anyone know how to solve it? @tashianasir?

mayankamedhe avatar May 21 '18 05:05 mayankamedhe

(I'm on Ubuntu 18.04)

I fixed it by manually compiling OpenCV and setting it to use GTK2.0. Make sure to enable WITH_GTK_2_X when configuring via CMake.

Afterwards you might face a new bug, if you use the most recent OpenCV version, about ::type not being a member or something (sry, dont have my logs anymore).

You need to change all: cv::Datatype< DT >::type to cv::traits::Type::value

Furthermore, in src/auxiliary/ocv_tools.cpp I needed to comment out a part of the code which is referencing a now out-dated datatype. Specifically this part:

#include <auxiliary/ocv_tools.h>
[...]

    // if(m.type() == cv::traits::Type<uint>::value)
    // {
    //     return "uint";
    // }

[...]

For me this doesn't break anything. If it does for you, either recompile OpenCV with deprecated types enabled in traits, or change to a new, equivalent type.

EDIT: For example, see https://github.com/ros-perception/image_pipeline/pull/302/files which performs a comparable fix in a DIFFERENT (aka unrelated) project.

dbadrian avatar Sep 03 '18 13:09 dbadrian

HELLO GUYS, After many months work with this error, I have just passed this by append this two lines in the head of the main python file. It will specify only version, which you want when your environment have many version of GTK. Good lucks ! import gi gi.require_version('Gtk', '2.0')

phamvandan avatar Nov 26 '19 02:11 phamvandan

gi

no module named gi!

imohammadhossein avatar Jul 22 '20 10:07 imohammadhossein

@phamvandan ValueError: Namespace Gtk is already loaded with version 3.0 when using gi.require_version('Gtk','2.0')

devkapilbansal avatar Jul 28 '20 18:07 devkapilbansal

@imohamadhoseins pip install gi

phamvandan avatar Oct 07 '20 07:10 phamvandan

@devkapilbansal Oh, i don't know this error

phamvandan avatar Oct 07 '20 07:10 phamvandan

@devkapilbansal Oh, i don't know this error

@phamvandan I found it. It was because I was using matplotlib and opencv at a same time and probably both uses different Gtk versions

devkapilbansal avatar Oct 07 '20 08:10 devkapilbansal

@devkapilbansal , yeah, I see.

phamvandan avatar Oct 08 '20 07:10 phamvandan

HELLO GUYS, After many months work with this error, I have just passed this by append this two lines in the head of the main python file. It will specify only version, which you want when your environment have many version of GTK. Good lucks ! import gi gi.require_version('Gtk', '2.0')

Thanks for the fix. Really helped

Achilles107 avatar Oct 12 '20 15:10 Achilles107

HELLO GUYS, After many months work with this error, I have just passed this by append this two lines in the head of the main python file. It will specify only version, which you want when your environment have many version of GTK. Good lucks ! import gi gi.require_version('Gtk', '2.0')

Thanks for the fix. Really helped

@Achilles107 where is the main python file in this repository?

aaaaangel avatar Nov 20 '20 09:11 aaaaangel

@devkapilbansal how did you solve the problem? were you able to use both together?

Vigneshpadoor avatar Dec 15 '20 01:12 Vigneshpadoor

@Vigneshpadoor I use opencv only there removing matplotlib and doing the changes in separate files

devkapilbansal avatar Dec 15 '20 13:12 devkapilbansal

import gi gi.require_version('Gtk', '2.0')

Could you elaborate how to implement the fix above pls? Thank you

Fix related to this error running eviacam: (eviacam:22012): Gtk-ERROR **: 15:04:20.718: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported Trace/breakpoint trap (core dumped)

u4david avatar Jan 27 '21 22:01 u4david

import gi gi.require_version('Gtk', '2.0')

Could you elaborate how to implement the fix above pls? Thank you

Fix related to this error running eviacam: (eviacam:22012): Gtk-ERROR **: 15:04:20.718: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported Trace/breakpoint trap (core dumped)

Just add it to the "TOP" of your python script or avoiding using both openCV and matplotlib

alao-emmanuel avatar Feb 21 '21 11:02 alao-emmanuel

In testing gtkmm3.x with openCV used, it will conflict with the default GTK+ 2.x installed. To this issue, I rebuild OpenCV by unchecking the option of GTK+ 2.x, then this error message disappears.

cjchng avatar Feb 21 '22 16:02 cjchng

HELLO GUYS, After many months work with this error, I have just passed this by append this two lines in the head of the main python file. It will specify only version, which you want when your environment have many version of GTK. Good lucks ! import gi gi.require_version('Gtk', '2.0')

How can this be implemented in c++?

MagnusErler avatar Nov 15 '22 11:11 MagnusErler

I'm not sure about that

On Tue, Nov 15, 2022 at 6:15 PM MagnusErler @.***> wrote:

HELLO GUYS, After many months work with this error, I have just passed this by append this two lines in the head of the main python file. It will specify only version, which you want when your environment have many version of GTK. Good lucks ! import gi gi.require_version('Gtk', '2.0')

How can this be implemented in c++?

— Reply to this email directly, view it on GitHub https://github.com/tum-vision/fastfusion/issues/21#issuecomment-1315163489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2WPYKMSHU5UP3SWFO5GT3WINWF3ANCNFSM4EFKIQ2Q . You are receiving this because you were mentioned.Message ID: @.***>

phamvandan avatar Nov 16 '22 01:11 phamvandan