wwylele / mhrice

Monster Hunter Rise information website
http://mhrice.info
Apache License 2.0
106 stars 8 forks source link

Could not find 'unix' in 'platform' when building on MacOS #10

Closed ericdolphf closed 2 years ago

ericdolphf commented 2 years ago

I tried to build the program on MacOS, by first installing rust using brew install rust, then checking version with cargo --version and an output of "cargo 1.53.0", then navigating to the root directory of this project, "mhrice-main", and finally build using cargo build. However, I encountered an error, claiming "could not find `unix` in `platform`". The complete stderr message is this log.txt, in which the error message is as follows:

error[E0432]: unresolved import glutin::platform::unix --> src/gpu/mod.rs:24:27 | 24 | use glutin::platform::unix::EventLoopExtUnix; | ^^^^ could not find unix in platform

error[E0599]: no function or associated item named new_any_thread found for struct EventLoop<_> in the current scope --> src/gpu/mod.rs:29:40 | 29 | glutin::event_loop::EventLoop::new_anythread(); | ^^^^^^^^^^^^^^ function or associated item not found in `EventLoop<>`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599. For more information about an error, try rustc --explain E0432. error: could not compile mhrice

To learn more, run the command again with --verbose.

wwylele commented 2 years ago

Thanks for the report. I'll try resolving the problem when I get my hand on a MacOS machine.

wwylele commented 2 years ago

I pushed a fix in https://github.com/wwylele/mhrice/commit/76c384de393a0a820c96c20d02f498b1a0bce61a . Could you verify that it works?

ericdolphf commented 2 years ago

Thanks! It works perfect! Except that instead of mhrice I would need to find the path of the executable: ./target/debug/mhrice -- definitely not a big deal though.

wwylele commented 2 years ago

As a tip, you can also do cargo run [--release] -- [arguments...]