jkvargas / russimp

Assimp bindings for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Russimp 2.0.6 fails to compile using msvc

teddemunnik opened this issue · comments

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

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"] }

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.

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.

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.