-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help getting samples going with MSYS2 installation of wxWidgets #190
Comments
Please help !! I'm keen to get this going and move on to supporting rust generated code from wxGlade :) |
Hello, Brendan, I'm sorry for too late reply. As I recently dedicated whole my spare time to another project these days. I have not been tried wxRust2 with MSYS2 environment generally. So my answer is not (yet) tested. At first, non-vendored, non-MSVC build of wxwidgets is not supported yet.
The wxRust2/wxrust-config/src/lib.rs Lines 61 to 94 in 43ec9e5
Theoretically, YES. It is rather compilcated as we have wxrust-config subcrate to integrate vendored binary.
May or may not. If you want simplify things to investigate in your source tree, change like this locally wx-base/build.rs // COMMENT OUT
// use wxrust_config::wx_config;
fn main() {
let mut cc_build = cc::Build::new();
// from `wx-config --cflags`
// CHANGE BELOW LINE
//let cflags = wx_config(&["--cflags"]);
let cflags = vec![
"PLACE YOUR".to_string(),
"wx-config --cflags".to_string(),
"OUTPUT, HERE.".to_string(),
];
for arg in cflags.iter() {
cc_build.flag(arg);
}
cc_build
.cpp(true)
.file("src/manual.cpp")
.file("src/generated/events.cpp")
.file("src/generated.cpp")
.include("include")
.flag_if_supported("-std=c++14")
// ignore too many warnings with wx3.0
.flag_if_supported("-Wno-deprecated-copy")
.flag_if_supported("-Wno-ignored-qualifiers")
.flag_if_supported("-Wno-unused-parameter")
.compile("wx");
// from `wx-config --libs`
// CHANGE BELOW LINE TOO
//let libs = wx_config(&["--libs"]);
let libs = vec![
"PLACE YOUR".to_string(),
"wx-config --libs".to_string(),
"OUTPUT, HERE.".to_string(),
];
println!("cargo:rustc-flags={}", libs.join(" "));
} Change wx-core/build.rs too. Additionally, rust projects (your application) which uses wxRust2 may need to specify RUSTFLAGS to Line 5 in 43ec9e5
For more context, see #91. If you successfully build with some modification on your environment, I'll try integrate your modifications. Of course, a PR is welcome as a starting point. |
Thanks for the info. I will take a closer look when I get a chance. BTW, the install on Mac with brew worked easily and I was able to test the examples. Seems very promising - all the widgets seem to work and render ok. Seems like writing useful applications should be possible 😃 |
I'm new to rust and have installed rust and wxwidgets 3.2 using MSYS2 (for ucrt64, clang64, and mingw64 environments)
I get errors about setting the
wxwin
environment variable.I've tried setting them to many things in the MSYS2 environments, and even tried downloading the binary and development files from wxWidgets and pointing to them, but no luck.
Surely the
wx-config --cflags
andwx-conig --libs
is all that is needed for thewxRust2
build system to find the headers and libraries. Yes/No?Does
wx-core/build.rs
need to be modified to support native MSYS2 installations ofwxwidgets
?What should I set
wxwin
to - if anything at all?NOTE: I have
wxRust2
running ok on macOS with brew installations of rust and wxwidgets.i.e. I can build and run the samples.
I want to be able to do the same thing on Windows using MSYS2 installations of rust and wxwidgets.
--
Here is the output with
wxwin
undefined.Thanks :)
The text was updated successfully, but these errors were encountered: