kosenko / ui

Boost.UI library
266 stars 18 forks source link

Failed updating 1 target #21

Closed UltraBlackLinux closed 1 year ago

UltraBlackLinux commented 1 year ago

Hey there, I gave compiling this another attempt and I actually got further, this time I got the following error:

...updating 40 targets...
gcc.link.dll bin.v2/libs/ui/build/gcc-12/debug/threading-multi/visibility-hidden/libboost_ui.so.1.79.0
/usr/bin/ld: cannot find -lwx_gtk2u_webview-3.0: No such file or directory
collect2: error: ld returned 1 exit status

I have installed wxwidgets-gtk3 after noticing this error, but nothing has changed. Why is this? Thanks!

kosenko commented 1 year ago

What OS you are using? uname -a? What result of wx-config --libs command? Do you have installed libwxgtk-webview3.0-dev package? Missing file is a part of wxWidgets build. Please ensure that it exists. It looks like you are using GTK+2/wxGTK2 instead of GTK+3/wxGTK3 for some reason. Also, it is possible to disable boost::ui::web_widget class under Linux if nothing else not works:

diff --git a/build/Jamfile.v2 b/build/Jamfile.v2
index 3633432..125a243 100644
--- a/build/Jamfile.v2
+++ b/build/Jamfile.v2
@@ -27,7 +27,7 @@ if [ modules.peek : UNIX ]
         CXXFLAGS  = [ SHELL $(WX_CONFIG)" --cxxflags" ] ;
         CXXFLAGS  = [ MATCH "(.*)[\n]" : $(CXXFLAGS) ] ;

-        LINKFLAGS = [ SHELL $(WX_CONFIG)" --libs webview,adv,core,base" ] ;
+        LINKFLAGS = [ SHELL $(WX_CONFIG)" --libs adv,core,base" ] ;
         LINKFLAGS = [ MATCH "(.*)[\n]" : $(LINKFLAGS) ] ;
     }
 }
diff --git a/src/web_widget.cpp b/src/web_widget.cpp
index b274262..6f55bc8 100644
--- a/src/web_widget.cpp
+++ b/src/web_widget.cpp
@@ -13,6 +13,9 @@

 #include <wx/webview.h>

+#undef wxUSE_WEBVIEW
+#define wxUSE_WEBVIEW 0
+
 namespace boost {
 namespace ui    {
UltraBlackLinux commented 1 year ago

What OS you are using? uname -a? What result of wx-config --libs command? Do you have installed libwxgtk-webview3.0-dev package? Missing file is a part of wxWidgets build. Please ensure that it exists. It looks like you are using GTK+2/wxGTK2 instead of GTK+3/wxGTK3 for some reason. Also, it is possible to disable boost::ui::web_widget class under Linux if nothing else not works

Oh sorry, my bad. I should have provided that info.

uname -a
Linux lolcat 5.18.13-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 22 Jul 2022 13:05:06 +0000 x86_64 GNU/Linux
... Garuda Linux
wx-config --libs
-pthread -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2

The libraries are there, just not used for some reason. I'm gonna see if I can change that gtk2 to gtk3.

Another weird thing: If I use my systemwide wx-config binary, the build process just fails since it can't find the necessary libraries (headers), so this only works with manually built wxwidgets.

kosenko commented 1 year ago

It seems you are trying to use wxWidgets dev build package with your own wxWidgets build. It is possible to switch to wxGTK3 with configure option --with-gtk=3. GTK+ could have problems with GtkWebKit with not compatible version. You should either use wxWidgets package and don't set WX_CONFIG variable. Or remove wxWidgets dev package from your OS.

UltraBlackLinux commented 1 year ago

It seems you are trying to use wxWidgets dev build package with your own wxWidgets build. It is possible to switch to wxGTK3 with configure option --with-gtk=3. GTK+ could have problems with GtkWebKit with not compatible version. You should either use wxWidgets package and don't set WX_CONFIG variable. Or remove wxWidgets dev package from your OS.

I don't understand this. I tried configure with --with-gtk=3 and --enable-webview but this just doesn't work at all. Please try to do some actions shenanigans because I for whatever reason can't build this no matter what. I want to use this library so bad. I hope this works at some point.

kosenko commented 1 year ago

Remove wxWidgets build directory and make clean build, see configure log setting and log messages before run make, especially related to webview. wxWebView requires additional packages to build. Sorry, but I know nothing about Arch Linux based distributions. If it doesn't help, you can disable boost::ui::web_widget and try it enable later (with clean build).

UltraBlackLinux commented 1 year ago

I found the issue... I might have tried the first build with my system-wide wxwidgets installation (Which didn't support gtk3 nor webview), so when I tried it with the wxwidgets I downloaded it wouldn't compile, since I apparently needed to delete the bin.v2 folder...

I never read about that anywhere once.

Thanks for trying to help.