HxWidgets Environnement

I have plenty of problems with haxe-widgets with segmentation faults ( but not with openfl), even with non custom components.
so I was thinking maybe I was not using the best version of wxwidgets. I compiled from the source.
So for those that are using hxwidgets, I was wondering which version you use ?

When you say compiling wxWidgets from source, what version do you mean? Also, what OS are you using? wx (and therefore hx) Widgets can be a pain… but i wouldnt expect alot of seg faults… do you have some small reproducible examples of what is dying? I can take a look this end and see if its any different.

Cheers,
Ian

Normally I’m using wx-widgets 3.1.4 ( at least wx-config tells me it’s 3.1.4)
haxe 4.1.2
I’m using Linux Ubuntu 16.04.

I had plenty of problems, mostly it was on kind of custom components.

But the latest one was on one of a very simple component. This one is easy to reproduce

Thread 1 “Main” received signal SIGSEGV, Segmentation fault.
0x0000555555d7c74e in haxe::ui::components::Stepper_obj::set_max(Dynamic) ()

( Oh funny thing, when I’m not putting any max , the max is 100)
But I have really plenty of different segmentation errors. That’s why before posting about them. I want to be sure that I have a good environment.

Can you post you full project?

BTW, i usually use wxWidgets + hxWidgets from git source… are you using haxeui? (ie, haxeui-hxwidgets)?

yes I’m using haxeui.

For the switch , I’ve build a project only with a switch and it doesn’t work.
So the main view is

<hbox width="100%" height="100%">
<number-stepper pos="75000" step="10" width ="30%" max ="90000" />
</hbox>

and with the Main

class Main {

public static var mainView: Component;

public static function main() {
    var app = new HaxeUIApp();
    app.ready(function() {
        mainView= ComponentMacros.buildComponent("assets/main-view.xml");
	app.addComponent(mainView);

        app.start();
    });
}

}

That’s why I think there something wrong with my environment.

A more general side question to @ianharrigan : How reliable is HaxeUI under Linux?

As a bit of background, I just gave it a try under LMDE Elsie = Debian Bullseye which now offers Haxe 4.1.5 and also I set up a fresh machine running openSuse Tumbleweed (Haxe 4.2.5). I got plenty of compilation errors (mostly in haxeui-core) on both, not only with wxWidgets but also with other targets. Only one that seems to work w/o headaches is html5.

Hey Jens,

So i know a bunch of people who use HaxeUI under linux (including native haxeui-hxwidgets backend) without issues - i might even go as far as to say it seems about 50% of users are using linux (i did just pull that number out of the air, but it certainly seems quite common).

What are the compilation issues? It sounds like you might have a hxcpp problem? Or if its just wxWidgets then maybe a wxWidgets problem? Did you compile wxWidgets from source? Its defo the best way to go for linux as the release versions (in my experience) are never “right” on linux. The saving grace is its super easy to compile wx in linux: GitHub - haxeui/hxWidgets: Haxe externs (and wrappers) for wxWidgets

(personally i would, and do, use the git version of wx)

Failing that, it might make sense to join the haxe discord (Haxe) if you arent already there? Its going to be alot simpler to diagnose issues there since there are a bunch of people using linux all the time that may be able to shed some light on the issue.

Cheers,
Ian

Except, for the wxWidget problem, which is only on one computer. ( it totally works on my raspberry pi)
I never had any problems.

Maybe post some of your compilation errors :slight_smile: It is may be something simple.

I also mostly use haxeui on git… But even, with haxelib versions, I don’t remember having problems.

1 Like

Just to also follow up on this, i fired up a new LDME Elsie VM:

  • installed haxe (3.1.5)
  • installed haxeui-core (git version)
  • installed haxeui-hxwidgets (git version)
  • installed hxWidgets (git version)
  • install hxcpp (haxelib release)
  • installed & built wxWidgets (git version, using instructions on hxWidgets)
  • created basic app (haxelib run haxeui-core create hxwidgets - in an empty dir)

All worked fine, no issues whatsoever (except the huge c++ compilation times ofc! - forgot to add more than one processor to the VM… zzzzzzzzz):

image

As @rationaldecay mentions, would be useful to see some of the errors, but feels like your system isnt setup for … … … something :slight_smile:

Cheers,
Ian

1 Like

Thank you both, I did the steps as written above and here are the results.

First, I now have on both this built and installed on both machines:

$ wx-config --selected-config
gtk3-unicode-static-3.1

Machine 1 (openSuse)

I was able to build and run the minimal example - perfect so far!

I then went on and compiled my real project, which failed at the linking step:

Link: Main-debug
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: warning: libjpeg.so.8, needed by /usr/lib64/gcc/x86_64-suse-linux/12/../../../../lib64/libgdk_pixbuf-2.0.so, may conflict with libjpeg.so.62
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: obj/linux64-debug/45a901b3_Menu.o: in function `wxMenuItemList::Clear()':
/usr/include/wx-3.1/wx/menu.h:37: undefined reference to `_WX_LIST_HELPER_wxMenuItemList::DeleteFunction(wxMenuItem*)'
collect2: Fehler: ld gab 1 als Ende-Status zurĂĽck
Error: Build failed

The only reference I found online was this thread, and I double-checked that STL is not enabled (it’s not): weird bug with STL ? - wxWidgets Discussion Forum

Machine 2 (Elsie)

I did all the same steps and got no error message, yet I always end up with this (note that it does not even say “wxWidgets version detected as …”) even at the minimal example:

$ haxe hxwidgets.hxml
(unknown) : Type not found : wx.widgets.EntryMacro

I did an strace and got this, but don’t really have a clue what it is telling me that’s missing.

openat(AT_FDCWD, "/usr/lib/haxe/std/eval/_std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/haxe/std/eval/_std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/bin/std/eval/_std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/jens/haxelib/hxWidgets/git/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/jens/haxelib/haxeui-hxwidgets/git/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/jens/haxelib/haxeui-core/git/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "src/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/haxe/extraLibs/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/haxe/extraLibs/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/bin/extraLibs/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/haxe/std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/haxe/std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/bin/std/wx/widgets", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
write(2, "(unknown) : Type not found : wx."..., 51(unknown) : Type not found : wx.widgets.EntryMacro
) = 51
exit_group(1)                           = ?
+++ exited with 1 +++

Do you have a minimal repro app for issue #1? Its a strange one for sure

As for the second, what does hxwidgets.hxml contain? How have you setup haxelib etc? It seems like its having issues finding the wx.widgets.EntryMacro class, which is essential for building - this indicates (to me at least) that hxWidgets isnt setup correctly somehow… have tried running any of the examples in the hxWidgets dir? Are you using git versions, yeah?

this looks like the one, however, i think it should be under a src dir, ie, /home/jens/haxelib/hxWidgets/git/src/wx/widgets

And that should be referenced in the haxelib.json… arguably this should be removed tbh, and ive been thinking of doing so, but for now, it would be good to understand the issue

how did you git install hxWidgets?

:laughing: The right question would have been “when” and the answer should have been “way too late at night”. Really stupid mistake. There’s definitely too many hx and wx around, so I managed to install the git version of wxWidgets to be my local hxWidgets. :roll_eyes: Obviously, that cannot work. Removing and installing the right one did the trick.

Trying to put an minimal example together for #1 … thanks again for your time!

2 Likes