Skip to content

Issue when building a crate with both bin and lib targets. #42

Description

@MaxMahem

I love the crate, but I did run into one issue, though. I'm not sure how much this is even something that can be solved. But when converting my bin crate over to also have a lib target (so I could do some integrated testing), I started having problems with my embedded resources not embedding properly. Part of it I think was a bug in the version you yanked (at least, upgrading to 1.23 fixed it). But after that the issue of my items not being embedded remained.

After some trial and error, I managed to fix it.

// force rustc to link to our windows embedded resource.
#[link(name = "resource", kind = "dylib")]
unsafe extern "C" {}

I'm a bit confused as to why it works, or why the resources were pruned to begin with? I didn't even think/know resources like this could get pruned.

Anyways, like I said, between Rust only having one build script per crate and whatever Rustc is doing (and what I might still be doing wrong), I'm not even sure there is anything to be fixed here. But I thought it might be worth letting you know.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions