nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Build Issue #451

Closed MicroChasm closed 2 years ago

MicroChasm commented 2 years ago

When I try to build I get these messages:

C:\Users\joelg\RustRoguelikeTiles>cargo run Compiling wfc-rs v0.5.2 Compiling roguelike_display v0.1.0 (C:\Users\joelg\RustRoguelikeTiles\roguelike_display) The following warnings were emitted during compilation:

warning: cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function'

error: failed to run custom build command for wfc-rs v0.5.2

Caused by: process didn't exit successfully: C:\Users\joelg\RustRoguelikeTiles\target\debug\build\wfc-rs-3dd0442e826e4f18\build-script-build (exit code: 1) --- stdout TARGET = Some("x86_64-pc-windows-msvc") OPT_LEVEL = Some("0") HOST = Some("x86_64-pc-windows-msvc") CC_x86_64-pc-windows-msvc = None CC_x86_64_pc_windows_msvc = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-msvc = None CFLAGS_x86_64_pc_windows_msvc = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") DEBUG = Some("true") running: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "wfc/" "-I" "csrc/" "-W4" "-Wno-unused-function" "-Wno-unused-variable" "-Wno-unused-parameter" "-Wno-unused-label" "-FoC:\Users\joelg\RustRoguelikeTiles\target\debug\build\wfc-rs-3c53f5f0556d7a6c\out\csrc/wfc.o" "-c" "csrc/wfc.c" cargo:warning=cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function' exit code: 2

--- stderr

error occurred: Command "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "wfc/" "-I" "csrc/" "-W4" "-Wno-unused-function" "-Wno-unused-variable" "-Wno-unused-parameter" "-Wno-unused-label" "-FoC:\Users\joelg\RustRoguelikeTiles\target\debug\build\wfc-rs-3c53f5f0556d7a6c\out\csrc/wfc.o" "-c" "csrc/wfc.c" with args "cl.exe" did not execute successfully (status code exit code: 2).

warning: build failed, waiting for other jobs to finish... error: build failed

nsmryan commented 2 years ago

Interesting. It looks like Rust is choosing to build the wfc-rs crate with the VIsual Studio compiler instead of gcc, and passing a flag that the compiler cl doesn't recognize. It would be nice to fix this in case someone else tries to build this way.

I wonder if you tried running with MingGW64 instead of MSYS2. The mingw executable and window is blue instead of purple.

If not, we should check the target build. The printout says x86_64-pc-windows-msvc, where I suspect I'm using something with msys or mingw in the name which will choose gcc.