haxeui / hxWidgets

Haxe externs (and wrappers) for wxWidgets
MIT License
77 stars 22 forks source link

Cant build showcase on Ubuntu 18.10 #57

Closed x17head closed 3 years ago

x17head commented 5 years ago

`- src/sys/io/Process.cpp

Up to date everything. Tried on hxcpp 4.0.4 and Git same result.

x17head commented 5 years ago

Just tried on Manjaro Linux. Same result.

ianharrigan commented 5 years ago

I think the issue is when you install wxWidgets you need to also install / build the extra libs that contain wxWebView. I cant remember off the top of my head which they are though, but i remember having to do it on linux.

ianharrigan commented 5 years ago

https://github.com/haxeui/hxWidgets/issues/36

?

x17head commented 5 years ago

not related to #36 webview3.0-dev is already installed. Manjaro i compiled from latest release of 3.0.4

x17head commented 5 years ago

haxelib run hxcpp Build.xml haxe -Dhaxe3="1" -Dhaxe_ver="3.407" -DhxWidgets="1.0.0" -Dhxcpp="4.0.4" -Dhxcpp_api_level="331" -Dsource-header="GeneratedByHaxe" -Dsource_header="GeneratedByHaxe" -I"src/" -I"/home/nate/haxelib/hxcpp/4,0,4/" -I"/home/nate/haxelib/hxWidgets/1,0,0/src/" -I"/usr/lib/haxe/extraLibs/" -I"/usr/share/haxe/extraLibs/" -I"" -I"/usr/lib/haxe/std/cpp/_std/" -I"/usr/share/haxe/std/cpp/_std/" -I"/usr/lib/haxe/std/" -I"/usr/share/haxe/std/" Creating /home/nate/Downloads/hxWidgets-master/samples/00-Showcase/bin/obj/linux64/__pch/haxe/hxcpp.h.gch...

Compiling group: haxe g++ -Iinclude -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -DWXGTK -pthread -I/home/nate/haxelib/hxWidgets/1,0,0/../include -c -fvisibility=hidden -O2 -fpic -fPIC -Wno-overflow -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -m64 -DHXCPP_M64 -I/home/nate/haxelib/hxcpp/4,0,4/include ... tags=[haxe,static]

ianharrigan commented 5 years ago

@ibilon - do you get similar results? Ill have to fire up the VM / linux box. @x17head - what version of haxe is this? What if you remove all the refs in the sample to webview? Does the error just move somewhere else? Or is it specific to webview?

ibilon commented 5 years ago

Can't test right now, but I remember having an issue like that once. Had to #if #end the parts about webview.

ianharrigan commented 5 years ago

@x17head: does removing webview from the sample help? Ie, is it just webview that causes the issue?

x17head commented 5 years ago

@ianharrigan I will try this tonight.

x17head commented 5 years ago

commenting out HTMLview still generates the same error.

x17head commented 5 years ago

My Haxe version is 3.4.7

x17head commented 5 years ago

Just installed Ubuntu Mate 16.04 and the sample compiles just fine (using current Pull from karliss) I noticed on my current system there is wx-config AND wx-config-3.0 . I don't know if this is related and have no idea how to dig into hxcpp to tweak it and see.

karliss commented 5 years ago

Build settings are in EntryMacro.hx. To get it running on my system I also had to add --toolkit=gtk3 because I had gtk2 and gtk3 based wxwidget versions and -DwxUSE_VEBVIEW=1 to enable the webview.

ianharrigan commented 5 years ago

I see - thats pretty interesting, i wonder if this should be added to EntryMacro in master? What do you think? I can see a reason why not?

Thanks for the info!

karliss commented 5 years ago

Adding DwxUSE_VEBVIEW=1 shouldn't. In the worst case it will show an error that wxwidgets is built in a way that doesn't allow enabling it which better than getting error about missing wxWebView type. Gtk3 is less clear, it should take least detect available backends instead blindly forcing gtk3.

ianharrigan commented 5 years ago

how are you passing wxUSE_WEBVIEW=1 in the sample build.hxml?

edit: same goes for gtk2 / 3 - i fired up a new VM and am getting similar to above

karliss commented 5 years ago

I added one more cflags += "\n<compilerflag line in hxWidget EntryMacro.hx.

ianharrigan commented 5 years ago

Can you paste it? Ive tried a few things, but none seem to be work (gtk2/3 flag too if you have it to hand)

ianharrigan commented 5 years ago

... ok, i had to manually go into the setup.h and edit wxUSE_WEBVIEW and wxUSE_WEBKIT

karliss commented 5 years ago

Here is what I currently use

--- a/src/wx/widgets/EntryMacro.hx
+++ b/src/wx/widgets/EntryMacro.hx
@@ -50,11 +50,11 @@ class EntryMacro {
                 return '<compilerflag value="$s" />';
             };

-            var config = new Process("wx-config", ["--cxxflags"]);
+            var config = new Process("wx-config-gtk3", ["--cxxflags"]);
             var cflags = config.stdout.readAll().toString().split("\n")[0].split(" ").map(makeFlag).join("\n");
             config.exitCode();

-            var config = new Process("wx-config", ["--libs", "gl,std,webview"]);
+            var config = new Process("wx-config-gtk3", ["--libs", "gl,std,webview"]);
             var libs = config.stdout.readAll().toString().split("\n").join(" ").split(" ");
             var link = [];
             var i = 0;
@@ -71,6 +71,7 @@ class EntryMacro {
             config.exitCode();

             cflags += "\n<compilerflag value=\"-I${haxelib:hxWidgets}/include\" />\n";
+            cflags += "\n<compilerflag value=\"-DwxUSE_WEBVIEW=1\" />\n";

Instead of using "wx-config-gtk3" executable passing "--toolkit=gtk3" to wx-config should also work.

Sl0vi commented 5 years ago

I'm experiencing the same issue on Linux Mint 19.1

I have to edit EntryMacro.hx and pass --toolkit=gtk3 to wx-config

ianharrigan commented 5 years ago

will that also work with gtk2?

Sl0vi commented 5 years ago

No, this flag tells the compiler to build the project specifically using gtk3. The build will fail if the gtk3 versions of the wxwidgets development libraries are not installed.

I managed to get project to build without adding --toolkit=gtk3 by removing all wxwidgets gtk2 development packages from my system.

The sample project cannot be built using gtk2 without removing the webview as there does not appear to be any gtk2 webview package in the repositories in Linux Mint 19.1.

Ubuntu 18.04 and newer and any distro based on them probably have the same issue.