Skip to content
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

Russimp 2.0.6 fails to compile using msvc #54

Open
teddemunnik opened this issue Jul 10, 2023 · 4 comments
Open

Russimp 2.0.6 fails to compile using msvc #54

teddemunnik opened this issue Jul 10, 2023 · 4 comments

Comments

@teddemunnik
Copy link

I'm attempting to use Russimp 2.0.6 with the prebuilt feature, however it's currently not compiling using msvc. I get the following compile error:

Compiling russimp v2.0.6
error[E0277]: the trait bound LightSourceType: From<i32> is not satisfied
--> C:\Users\tedde.cargo\registry\src\github.com-1ecc6299db9ec823\russimp-2.0.6\src\light.rs:40:46
|
40 | light_source_type: (light.mType).into(),
| ^^^^ the trait From<i32> is not implemented for LightSourceType
|
= help: the trait From<u32> is implemented for LightSourceType
= note: required for i32 to implement Into<LightSourceType>

For more information about this error, try rustc --explain E0277.
error: could not compile russimp due to previous error

It appears that light.mType is u32 on other platforms, but i32 when compiling with msvc.
See: rust-lang/rust-bindgen#1361

@teddemunnik
Copy link
Author

Looks like the pending pull request #53 will fix this.

In the meantime, it's possible to work around this by using version 2.0.5 explicitly.
russimp = { version = "=2.0.5", features=["prebuilt"] }

@jkvargas
Copy link
Owner

Hey @teddemunnik,
Thanks for letting me know of this.
I've been busy and dealing with some stuff for a while.
Would you mind to try to build russimp 3.1.1 on windows?
Thanks dude.

@joervargas
Copy link

Hello. Appreciate the work on this crate!
I have just tried to compile 3.1.1 on Windows. I have tried both "prebuilt" and "static-link" features and received different errors.

When I try to build with "static-link" feature, I get an error that no CMakeLists.txt exists in the source directory.

CMake Error: The source directory "C:/Users/joerv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/russimp-sys-2.0.1/assimp" does not appear to contain CMakeLists.txt.

When I try to build using the "prebuilt" feature, I get a mismatched types error. Compiler expected a u32 but found an i32.

error[E0308]: mismatched types
--> C:\Users\joerv.cargo\registry\src\index.crates.io-6f17d22bba15001f\russimp-3.1.1\src\mesh.rs:52:21
|
52 | method: mesh.mMethod,
| ^^^^^^^^^^^^ expected u32, found i32
For more information about this error, try rustc --explain E0308.

@jkvargas
Copy link
Owner

hi @joervargas,
There is a lot of work to be done regarding windows.
Russimp needs a worker on the pipeline in order to build and run tests for windows so we can know what is failing and try to fix it.
Not to mention people to help on the windows side =)
I already moved to other projects so basically right now I am just accepting PRs.

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

No branches or pull requests

3 participants