Home » Community » U++ community news and announcements » MILESTONE: gtk3 replaces gtk2 as default linux backend
| Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52932 is a reply to message #52930] |
Tue, 14 January 2020 11:36   |
 |
mirek
Messages: 14291 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Tue, 14 January 2020 09:21Hi,
My OpenGL (GLCtrl) based applications now crash on startup. I did a full rebuild, but still the result is this:
tom@tom-LM-WMV:~/upp.out/program52/CLANG.Gui.Shared$ ./GLModeler
(GLModeler:5955): Gtk-ERROR **: 10:07:31.280: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap (core dumped)
tom@tom-LM-WMV:~/upp.out/program52/CLANG.Gui.Shared$
Here's the backtrace:
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_writer_default () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_structured_array () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_structured_standard () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0
g_option_context_parse () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
gtk_parse_args () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
gtk_init_check () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
gtk_init () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
Upp::InitGtkApp (argc=1, argv=0x7fffffffe448, envptr=0x7fffffffe458) at /home/tom/upp.src/uppsrc/CtrlCore/GtkApp.cpp:74
main (argc=1, argv=0x7fffffffe448, envptr=0x7fffffffe458) at /mnt/hgfs/program52/GLModeler/GLModeler.cpp:3
Am I doing something wrong here? (I have not changed anything in my code and it used to work on Linux. It still works on Windows.)
Best regards,
Tom
Can you retry now? I have removed dependency on gtkglext, which we are not using anyway.
If it still does not work, do non-GL examples work for you?
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52944 is a reply to message #52943] |
Thu, 16 January 2020 11:18   |
 |
mirek
Messages: 14291 Registered: November 2005
|
Ultimate Member |
|
|
mr_ped wrote on Thu, 16 January 2020 11:05This sounds like lot of fun.
I guess dropping support for status icons in Gtk is legitimate option, as that's how the Gnome authors envision it and how they want it.
But as a KDE user, I would prefer if there were still APIs and tools in U++ to handle status icons normally.
But U++ is GTK3 based now, so ... I don't know. Maybe the X11 without GTK branch only to keep them supported and GTK3 branch to ignore any U++ API calls?
Seems quite awkward situation to me, I definitely like existence of status icons in the task bar in my desktop environment, and if some app is overusing it, I can uninstall the particular app. But I don't understand Gnome design decisions for many years, so this is just another one, I simply think completely differently about my computer "desk".
No worries, I have kept it with warnings disabled. Perhaps in future, if they decide to drop it, I can switch to X11 implementation, which is possible even with gtk3 backend. For now, problem solved.
(And yes, it is idiotic decision on gtk3 part. If they present it as multi-platform toolkit, they should care about more than Gnome).
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52953 is a reply to message #52902] |
Mon, 20 January 2020 20:51   |
 |
amrein
Messages: 278 Registered: August 2008 Location: France
|
Experienced Member |
|
|
All POSIX OS have pkg-config in their repository. You must install pkg-config manually (using the distro package manager) as it's not installed by default when you install other devel packages. If so, this dependency need to be added in docs.
The main idea of using pkg-config is to have dynamic cflags and libs on any POSIX OS I guess.
So for me, the best strategy would be to add LDLIBS in Makefile using pkg-config (after CINC and at link time):
CINC = -I./ `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags libpng` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmpc` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify`
LDLIBS = `pkg-config --libs freetype2` `pkg-config --libs x11` `pkg-config --libs fontconfig` `pkg-config --libs xcb` `pkg-config --libs expat` `pkg-config --libs libpng` `pkg-config --libs xinerama` `pkg-config --libs xrender` `pkg-config --libs xft` `pkg-config --libs xdmpc` `pkg-config --libs xext` `pkg-config --libs gtk+-3.0` `pkg-config --libs libnotify` -lbz2 -lpthread -ldl -lrt -lz
...
$(OutDir_plugin_bmp)BmpReg.o \
$(OutDir_plugin_bmp)bmp.a \
$(OutDir_RichText)RichText.a \
$(LDLIBS) -Wl,--end-group
That way, it easier for external script like domake to change Makefiles configuration dynamically using its own CINC and LDLIBS.
Note: It would be even more fun to use Flags to switch Makefile from one configuration to another but my investigation in this area showed several flows because of POSIX gmake differences between OS.
[Updated on: Mon, 20 January 2020 21:02] Report message to a moderator
|
|
|
|
|
|
| Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52955 is a reply to message #52954] |
Tue, 21 January 2020 10:32   |
 |
amrein
Messages: 278 Registered: August 2008 Location: France
|
Experienced Member |
|
|
Example on Fedora:
$ lsb_release -sir
Fedora 31
$ rpm -q --whatrequires pkg-config
no package requires pkg-config
$ rpm -qa | grep devel | wc -l
114
So on a full Fedora installation with all U++ dependencies installed and much more... not a single package requires pkg-config.
So no, you need to manually install pkg-config on most POSIX OS. It's not more complicated than installing other U++ build dependencies.
[Updated on: Tue, 21 January 2020 10:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
| Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52961 is a reply to message #52960] |
Wed, 22 January 2020 00:05   |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Hi, Amrein.
amrein wrote on Tue, 21 January 2020 21:19
If U++ uses GTK3 only, x11 or libnotify are not required.
<..>
So if I'm not wrong, this part of the patch is incorrect:
<..>
and should be replaced by
-pkg_config((LINUX | FREEBSD) !X11) "gtk+-3.0 libnotify";
+pkg_config(POSIX !X11 (!OSX | OSX11)) "gtk+-3.0 libnotify";
If use
pkg_config(POSIX !X11 (!OSX | OSX11)) "gtk+-3.0 libnotify";
or
pkg_config(POSIX !X11 (!OSX | OSX11)) "gtk+-3.0";
in uppsrc/CtrlCore package to build examples/AddressBook for GUI main package configuration, then there is following linker error:
Linking...
/usr/bin/ld: undefined reference to symbol `XFlush' (try adding -lX11)
//usr/local/lib/libX11.so.6: could not read symbols: Bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
The XFlush function is used in GetProperty function in uppsrc/CtrlCore/GtkX11Util.cpp file for GUI_GTK define. This is why !X11 (GTK 3) case requires x11 pkg-config dependency (at least on FreeBSD, where other specified pkg-config dependencies didn't include x11 implicitly).
% ldd -a ./AddressBook | sed 's/ (.*)$// ; s|^/.*/||' | head -27
AddressBook:
libgtk-3.so.0 => /usr/local/lib/libgtk-3.so.0
libgdk-3.so.0 => /usr/local/lib/libgdk-3.so.0
libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0
libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0
libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0
libcairo-gobject.so.2 => /usr/local/lib/libcairo-gobject.so.2
libcairo.so.2 => /usr/local/lib/libcairo.so.2
libthr.so.3 => /lib/libthr.so.3
libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0
libintl.so.8 => /usr/local/lib/libintl.so.8
libX11.so.6 => /usr/local/lib/libX11.so.6
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6
libpng16.so.16 => /usr/local/lib/libpng16.so.16
libz.so.6 => /lib/libz.so.6
librt.so.1 => /usr/lib/librt.so.1
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1
libc++.so.1 => /usr/lib/libc++.so.1
libcxxrt.so.1 => /lib/libcxxrt.so.1
libm.so.5 => /lib/libm.so.5
libgcc_s.so.1 => /lib/libgcc_s.so.1
libc.so.7 => /lib/libc.so.7
libgtk-3.so.0:
Some example of pkg-config output for libnotify and x11 on FreeBSD 10.4:
% pkg-config -cflags -libs libnotify
-I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread -L/usr/local/lib -lnotify -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
% pkg-config -cflags -libs x11
-I/usr/local/include -D_THREAD_SAFE -pthread -L/usr/local/lib -lX11
Edit:
But after build test for reference/TrayIcon package, there was following linker error:
<..>/CtrlLib/CLANG.Gui.Shared/CtrlLib.a(TrayIconGtk.o): In function `Upp::TrayIcon::Message(int, char const*, char const*, int)':
<..>/upp/uppsrc/CtrlLib/TrayIconGtk.cpp:(.text._ZN3Upp8TrayIcon7MessageEiPKcS2_i+0x1b): undefined reference to `notify_is_initted'
<..>/upp/uppsrc/CtrlLib/TrayIconGtk.cpp:(.text._ZN3Upp8TrayIcon7MessageEiPKcS2_i+0x27): undefined reference to `notify_init'
<..>/upp/uppsrc/CtrlLib/TrayIconGtk.cpp:(.text._ZN3Upp8TrayIcon7MessageEiPKcS2_i+0x59): undefined reference to `notify_notification_new'
<..>/upp/uppsrc/CtrlLib/TrayIconGtk.cpp:(.text._ZN3Upp8TrayIcon7MessageEiPKcS2_i+0x6b): undefined reference to `notify_notification_set_timeout'
<..>/upp/uppsrc/CtrlLib/TrayIconGtk.cpp:(.text._ZN3Upp8TrayIcon7MessageEiPKcS2_i+0x77): undefined reference to `notify_notification_show'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
where mentioned functions are used in TrayIcon::Message method in uppsrc/CtrlLib/TrayIconGtk.cpp file.
This may mean, that libnotify package dependency is required for some cases in uppsrc/CtrlLib package.
Possible to add following check for uppsrc/CtrlLib package:
pkg_config(POSIX !X11 (!OSX | OSX11)) libnotify;
Example of ldd output for TrayIcon and AddressBook executables for this case, which library dependencies are the same:
Click to expand
% ldd -a ./TrayIcon | sed 's/ (.*)$// ; s|^/.*/||' | head -28
TrayIcon:
libnotify.so.4 => /usr/local/lib/libnotify.so.4
libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0
libintl.so.8 => /usr/local/lib/libintl.so.8
libgtk-3.so.0 => /usr/local/lib/libgtk-3.so.0
libgdk-3.so.0 => /usr/local/lib/libgdk-3.so.0
libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0
libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0
libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0
libcairo-gobject.so.2 => /usr/local/lib/libcairo-gobject.so.2
libcairo.so.2 => /usr/local/lib/libcairo.so.2
libthr.so.3 => /lib/libthr.so.3
libX11.so.6 => /usr/local/lib/libX11.so.6
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6
libpng16.so.16 => /usr/local/lib/libpng16.so.16
libz.so.6 => /lib/libz.so.6
librt.so.1 => /usr/lib/librt.so.1
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1
libc++.so.1 => /usr/lib/libc++.so.1
libcxxrt.so.1 => /lib/libcxxrt.so.1
libm.so.5 => /lib/libm.so.5
libgcc_s.so.1 => /lib/libgcc_s.so.1
libc.so.7 => /lib/libc.so.7
libnotify.so.4:
% ldd -a ./AddressBook | sed 's/ (.*)$// ; s|^/.*/||' | head -28
AddressBook:
libnotify.so.4 => /usr/local/lib/libnotify.so.4
libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0
libintl.so.8 => /usr/local/lib/libintl.so.8
libgtk-3.so.0 => /usr/local/lib/libgtk-3.so.0
libgdk-3.so.0 => /usr/local/lib/libgdk-3.so.0
libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0
libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0
libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0
libcairo-gobject.so.2 => /usr/local/lib/libcairo-gobject.so.2
libcairo.so.2 => /usr/local/lib/libcairo.so.2
libthr.so.3 => /lib/libthr.so.3
libX11.so.6 => /usr/local/lib/libX11.so.6
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6
libpng16.so.16 => /usr/local/lib/libpng16.so.16
libz.so.6 => /lib/libz.so.6
librt.so.1 => /usr/lib/librt.so.1
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1
libc++.so.1 => /usr/lib/libc++.so.1
libcxxrt.so.1 => /lib/libcxxrt.so.1
libm.so.5 => /lib/libm.so.5
libgcc_s.so.1 => /lib/libgcc_s.so.1
libc.so.7 => /lib/libc.so.7
libnotify.so.4:
Thanks for your attention.
[Updated on: Wed, 22 January 2020 04:14] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Oct 04 16:35:01 GMT+2 2026
Total time taken to generate the page: 0.01731 seconds
|