Closed x17head closed 3 years ago
Just tried on Manjaro Linux. Same result.
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.
not related to #36 webview3.0-dev is already installed. Manjaro i compiled from latest release of 3.0.4
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]
@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?
Can't test right now, but I remember having an issue like that once.
Had to #if #end
the parts about webview.
@x17head: does removing webview from the sample help? Ie, is it just webview that causes the issue?
@ianharrigan I will try this tonight.
commenting out HTMLview still generates the same error.
My Haxe version is 3.4.7
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.
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.
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!
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.
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
I added one more cflags += "\n<compilerflag
line in hxWidget EntryMacro.hx.
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)
... ok, i had to manually go into the setup.h and edit wxUSE_WEBVIEW
and wxUSE_WEBKIT
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.
I'm experiencing the same issue on Linux Mint 19.1
I have to edit EntryMacro.hx and pass --toolkit=gtk3 to wx-config
will that also work with gtk2?
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.
`- src/sys/io/Process.cpp
~~~~ include/hx/widgets/WebView.h:63:20: note: suggested alternative: ‘WebView’ ::cpp::Pointer< wxWebView > webViewRef; ^~~~~ WebView include/hx/widgets/WebView.h:63:30: error: template argument 1 is invalid ::cpp::Pointer< wxWebView > webViewRef; ^ include/hx/widgets/WebView.h:64:20: error: ‘wxWebView’ was not declared in this scope ::cpp::Pointer< wxWebView > get_webViewRef(); ^~~~~ include/hx/widgets/WebView.h:64:20: note: suggested alternative: ‘WebView’ ::cpp::Pointer< wxWebView > get_webViewRef(); ^~~~~ WebView include/hx/widgets/WebView.h:64:30: error: template argument 1 is invalid ::cpp::Pointer< wxWebView > get_webViewRef(); ^ Error: Build failed `Up to date everything. Tried on hxcpp 4.0.4 and Git same result.