tum-vision / fastfusion

Volumetric 3D Mapping in Real-Time on a CPU
GNU General Public License v2.0
559 stars 173 forks source link

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

Open tashianasir opened 6 years ago

tashianasir commented 6 years ago

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 commented 6 years ago

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)

`

mayankamedhe commented 6 years ago

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

dbadrian commented 6 years ago

(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.

phamvandan commented 4 years ago

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')

imohammadhossein commented 4 years ago

gi

no module named gi!

devkapilbansal commented 4 years ago

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

phamvandan commented 3 years ago

@imohamadhoseins pip install gi

phamvandan commented 3 years ago

@devkapilbansal Oh, i don't know this error

devkapilbansal commented 3 years ago

@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

phamvandan commented 3 years ago

@devkapilbansal , yeah, I see.

Achilles107 commented 3 years ago

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

aaaaangel commented 3 years ago

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?

Vigneshpadoor commented 3 years ago

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

devkapilbansal commented 3 years ago

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

u4david commented 3 years ago

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)

alao-emmanuel commented 3 years ago

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

cjchng commented 2 years ago

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.

MagnusErler commented 1 year ago

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++?

phamvandan commented 1 year ago

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: @.***>