Skip to content

fix(855): Windows build #861

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshuamegnauth54
Copy link

Closes: #855

The original issue mentions that several examples fail to build. They fail to build on Linux as well due to bit rot. I started fixing some of those issues until I realized that this is a larger project than I expected. 😆 So, this PR mainly fixes the Windows build.

@ti-integra
Copy link

ti-integra commented Apr 29, 2025

build error

error: invalid format string: expected `}`, found `$`
   --> src\widget\header_bar.rs:428:43
    |
428 |                         "../../res/icons/{$name}.svg"
    |                                          -^ expected `}` in format string
    |                                          |
    |                                          because of this opening brace
    

the error point to here

    #[cfg(not(target_os = "linux"))]
                let icon = {
                    widget::icon::from_svg_bytes(include_bytes!(format!(
                        "../../res/icons/{$name}.svg"
                    )))
                    .symbolic(true)
                    .apply(widget::button::icon)
                    .padding(8)
                };

using this also in windows

                let icon = {
                    widget::icon::from_name($name)
                        .apply(widget::button::icon)
                        .padding(8)
                };

was able build table-view and spin-button but without icons

image

@joshuamegnauth54
Copy link
Author

Sorry. I'm going to fix this today since I have time. 😁

@joshuamegnauth54 joshuamegnauth54 force-pushed the fix-855-windows-build branch 4 times, most recently from c88b61a to 72ae2da Compare April 30, 2025 05:08
@joshuamegnauth54 joshuamegnauth54 marked this pull request as ready for review April 30, 2025 05:10
I also cleaned up some of the examples but they're nowhere near
finished yet.
@joshuamegnauth54
Copy link
Author

This works now if you would like to use it before it's merged. The fix is a one-liner for the library, but I'll tackle some of the examples in another PR since it's a larger project.

@tredeneo
Copy link

tredeneo commented May 1, 2025

I have upgrade to last commit and build table-view example without errors, with icons

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fail build on windows
3 participants