russimp icon indicating copy to clipboard operation
russimp copied to clipboard

Russimp 2.0.6 fails to compile using msvc

Open teddemunnik opened this issue 1 year ago • 4 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: https://github.com/rust-lang/rust-bindgen/issues/1361

teddemunnik avatar Jul 10 '23 18:07 teddemunnik

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

teddemunnik avatar Jul 10 '23 18:07 teddemunnik

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.

jkvargas avatar Jan 16 '24 12:01 jkvargas

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.

joervargas avatar Jan 29 '24 13:01 joervargas

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.

jkvargas avatar Feb 23 '24 18:02 jkvargas