Rust Compile Note

谈一些在编译时遇见的问题与语法笔记。

Modules

In main.rs

1
2
mod hello;
use hello::helloworld;

In hello.rs

1
pub fn helloworld () { }

Error Occurs

MSYS/MINGW + cmake error

When compiling a crate using cmake:

1
2
$ cmake -G "MSYS Makefiles" ..
CMake Error: Could not create named generator MSYS Makefiles

Instead of installing the cmake package, I think you need to install mingw-w64-i686-cmake (or the 64-bit version mingw-w64-x86_64-cmake).

1
$ pacman -S mingw-w64-x86_64-cmake
Share