kenz-gelsoft / wxRust2

re-exploration Rust binding to wx
MIT License
78 stars 10 forks source link

Minimal example fails to compile under Linux #41

Closed ancwrd1 closed 2 years ago

ancwrd1 commented 2 years ago

The following compilation errors are shown:

src/generated.cpp:823:18: error: ‘class wxWindow’ has no member named ‘RegisterHotKey’
src/generated.cpp:826:18: error: ‘class wxWindow’ has no member named ‘UnregisterHotKey’

I think this happens because those methods are only available on Windows.

kenz-gelsoft commented 2 years ago

Thank you for your feedback. Please let me know about your environment?

I know some wx APIs are platform-specific,

but I did only some hacky blocklisting them with very-limited environments, for Linux:

I'm working mainly on MacOS and Windows 10 for now.

Will consider marking those APIs with #[cfg(target=somewhat)] next.

ancwrd1 commented 2 years ago

I tried it with openSUSE Tumbleweed and wxWidgets 3.1.5 (GTK3).

Interesting though, the documentation of RegisterHotKey says the following: This function is currently only implemented under MSW and macOS and always returns false in the other ports..

kenz-gelsoft commented 2 years ago

I couldn't use the codelite's prebuilt packages since I have only arm64 envs. I rebuilt it for arm64 and I just got testing environment for wx3.1 on Linux.

I'll work around this by just blocking not supported APIs you reported (RegisterHotKey (and UnregisterHotKey)) for now.

About per-platform code generation, I'll work on it in https://github.com/kenz-gelsoft/wxRust2/issues/42.