I’ve been trying to build Cargo on Windows, but I’ve been stumbling on a few places.
The main issue being,
cargo build complains GCC is not found. The error message links to https://github.com/alexcrichton/gcc-rs#compile-time-requirements which says GCC from MSys should be installed, but from what @alexcrichton mentioned in IRC the GCC bundled with the Rust installation should be used.
Is that meant to be done automatically by Cargo, or do I need to add Rust’s GCC to the PATH manually? I tried the later but it still didn’t work (different error message)
Full error message:
$ cargo build Compiling url v1.2.3 Compiling miniz-sys v0.1.7 Compiling fs2 v0.3.0 Compiling term v0.4.4 Build failed, waiting for other jobs to finish... error: failed to run custom build command for `miniz-sys v0.1.7` process didn't exit successfully: `D:\devel\rust\cargo0\target\debug\build\miniz-sys-60c8d67696f63a43\build-script-build` (exit code: 101) --- stdout TARGET = Some("x86_64-pc-windows-gnu") OPT_LEVEL = Some("0") PROFILE = Some("debug") TARGET = Some("x86_64-pc-windows-gnu") debug=true opt-level=0 HOST = Some("x86_64-pc-windows-gnu") TARGET = Some("x86_64-pc-windows-gnu") TARGET = Some("x86_64-pc-windows-gnu") HOST = Some("x86_64-pc-windows-gnu") CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None TARGET = Some("x86_64-pc-windows-gnu") HOST = Some("x86_64-pc-windows-gnu") CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None running: "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-o" "D:\\devel\\rust\\cargo0\\target\\debug\\build\\miniz-sys-60c8d67696f63a43\\out\\miniz.o" "-c" "miniz.c" failed to execute command: The system cannot find the file specified. (os error 2) Is `gcc.exe` not installed? (see https://github.com/alexcrichton/gcc-rs#compile-time-requirements for help) --- stderr thread 'main' panicked at 'explicit panic', C:\Users\bruno\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.38\src\lib.rs:958 note: Run with `RUST_BACKTRACE=1` for a backtrace.