Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK-3 support ? #14

Open
kyrios123 opened this issue Jan 29, 2018 · 17 comments
Open

GTK-3 support ? #14

kyrios123 opened this issue Jan 29, 2018 · 17 comments

Comments

@kyrios123
Copy link

Hello,

Is there any plan for supporting gtk-3 ?
We are considering retiring wxWidgets gtk-2 build and eviacam is one of the only blocker.

Thank you !

@cmauri
Copy link
Owner

cmauri commented Feb 6, 2018

Hi!
Solus distro? Who is the maintainer of the package? Did you try building eViacam against wxWidgets gtk-3 build?

Thanks!

@kyrios123
Copy link
Author

yes I did, that's why I made this request

@cmauri
Copy link
Owner

cmauri commented Feb 13, 2018

Added support for gtk+-3 in commit 6cd6ea9

@kyrios123
Copy link
Author

I confirm it builds successfully with the patch.
I will do some testing during the coming days.

@kyrios123
Copy link
Author

Hello,

I get the following error when launching the patched version (of course I did replace gtk2 libs with gtk3 libs and I used a gtk3 build of wxwidgets)

(eviacam:3978): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap

@cmauri
Copy link
Owner

cmauri commented Feb 28, 2018

Hello,

I tried the following on a clean chrooted ubuntu artful installation:

$ dpkg -l | grep -E "gtk|opencv|wx"
(no results)

$ sudo apt-get install libopencv-dev
(this command installs around 350 packages)

$ dpkg -l | grep -E "gtk"

ii  gtk-update-icon-cache           3.22.24-0ubuntu1                  amd64       
ii  libgtk-3-0:amd64                3.22.24-0ubuntu1                  amd64 
ii  libgtk-3-bin                    3.22.24-0ubuntu1                  amd64  
ii  libgtk-3-common                 3.22.24-0ubuntu1                  all 

libopencv installs libgtk-3.0 because some modules have dependencies on it. I only had to manually install libgtk-3-dev
$ sudo apt-get install libgtk-3-dev

To install wxWidgets I used the latest stable tarball for linux. I configured it to use gtk-3 and compiled manually:

./configure --with-gtk=3
make
sudo make install
sudo ldconfig

Finally, I managed to build (from commit a598ace) and run eviacam without issues. These are the steps I followed:

./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
eviacam

However, when installing wxWidgets from ubuntu repository, i.e.: $ sudo apt-get install libwxgtk3.0-dev eviacam build fails with:

In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gdk/gdkx.h:28,
                 from wxappbar.cpp:46:
/usr/include/gtk-3.0/gdk/gdktypes.h:143:39: error: conflicting declaration 'typedef struct _GdkWindow GdkWindow'
 typedef struct _GdkWindow             GdkWindow;
                                       ^~~~~~~~~
In file included from /usr/include/wx-3.0/wx/wxprec.h:12:0,
                 from wxappbar.cpp:24:
/usr/include/wx-3.0/wx/defs.h:3466:33: note: previous declaration as 'typedef struct _GdkDrawable GdkWindow'
     typedef struct _GdkDrawable GdkWindow;
                                 ^~~~~~~~~

Checking the wxWidgets version shipped with artful:

$ wx-config --selected-config 
gtk2-unicode-3.0

it is clear that has been built against gtk-2. In fact, there is an open bug in ubuntu launchpad about this:
https://bugs.launchpad.net/ubuntu/+source/wxwidgets3.0/+bug/1394031

Furthermore, when running the eviacam version shipped with artful I also get:

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

In summary, @kyrios123 make sure that both libopencv and wxWidgets are build against gtk-3 and that no other libraries add dependencies to gtk-2.

It seems also that recent versions of debian (strech) and ubuntu (artful) provide wxWidgets built against gtk-2 and libopencv against gtk-3 and thus, software that need both libraries will probably crash with the same error.

@kyrios123
Copy link
Author

Thanks for this very useful feedback! Indeed, I see our opencv currently uses gtk-2 libraries.

@kyrios123
Copy link
Author

We are currently testing the gtk3 vs gtk2 builds and the following issue has been reported: Takes forever getting the webcam via v4l

@JoshStrobl
Copy link

When launching from the Terminal, it starts my webcam, turns it back off, and then provides an index error. It cycles through 9 indexes until it gets to my webcam (the only video device I have), then starts the OpenCL runtime.

VIDEOIO ERROR: V4L: index 1 is not correct!
VIDEOIO ERROR: V4L: index 2 is not correct!
VIDEOIO ERROR: V4L: index 3 is not correct!
VIDEOIO ERROR: V4L: index 4 is not correct!
VIDEOIO ERROR: V4L: index 5 is not correct!
VIDEOIO ERROR: V4L: index 6 is not correct!
VIDEOIO ERROR: V4L: index 7 is not correct!
VIDEOIO ERROR: V4L: index 8 is not correct!
VIDEOIO ERROR: V4L: index 9 is not correct!
[ INFO:1] Initialize OpenCL runtime...

@cmauri
Copy link
Owner

cmauri commented Mar 8, 2018

Try applying the following patch. It basically disables multiple camera detection:
patch.diff.gz

@JoshStrobl
Copy link

JoshStrobl commented Mar 8, 2018

@cmauri Applied patch, did a local build, same behavior as my previous comment. Here's an strace if it's any help. Webcam is a Logitech HD Pro Webcam C920.

eviacam_strace.txt (~2.6MB)

@cmauri
Copy link
Owner

cmauri commented Mar 26, 2018

output.txt
@JoshStrobl also applied the patch and, for me, this only opens the camera once. Here is the output of eviacam when running with the debug flag enabled:

./eviacam --debug

Could you please run also in debug mode and attach the output?

Remember that you should clone the devel branch and apply the patch on top of it.

@Clement-TS
Copy link

Clement-TS commented Nov 26, 2018

I there, I have this same issue using eviacam on a Ubuntu 18.04 desktop (was working on 16.04):

(eviacam:23589): Gtk-ERROR **: 16:01:44.053: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap

Is this fixed within the devel branch? Are there .deb available with any fix on that?
Thank you

@kyrios123
Copy link
Author

@Clement-TS yes look at the detailed explanation here. TL;DR make sure that wxWidgets and openCV are built against the same version of GTK+ than eviacam

@cmauri
Copy link
Owner

cmauri commented May 13, 2019

Revisiting this issue in May 2019, it seems that since Debian 10 and Ubuntu 18.10 this issue should have been fixed. Package libwxgtk3.0-gtk3-0v5 was added to the distro and the eviacam dependencies were fixed.

However, for previous Debian and Ubuntu releases, and other distributions based on such older versions (for instance, Linux Mint 19) ship with a broken eviacam package. In this case, you might find useful the installation script written by @Cat5TV and the Episode 607 of his Category5 Technology TV.

@Daniel78ar
Copy link

Good afternoon. Well, in my case, I solve the issue with the next steps. Install viacam from synaptic. First download wxwidgets 3.1.2 from wxwidgetx.org and unzip and install with sudo ./configure in a console (konsole or tilix) make and make install. After this download the viacam from the source from https://eviacam.crea-si.com/index_es.php (codigo fuente/source code 2.1.1 or new). Install in synaptics the next files gtk2-dev libopencv-dev because the dependencies requeriments from evince. After this
Unzip the file in the personal folder that you need to indicate the eviacam folder, and when installing it do the following: sudo ./configure and then make -i and make install -i, to ignore the errors. This is because the versions of wxwidgets and eviacam are updated when you install the files from compilation process. The next thing is to go to https://packages.ubuntu.com/eoan/eviacam, download the file en deb format and install with gdebi gtk or in a console (gdebi *.deb or eviacam) and install the file. This solve the issue. I test the program eviacam and works in ubuntu 18.04!

@wibcode
Copy link

wibcode commented Jun 30, 2021

Good evening, after installing I get the following error: eviacam: /usr/local/lib/libwx_gtk3u_core-3.0.so.0: version `WXU_3.0.5 'not found (required by eviacam)

how could i solve it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants