rust - Actix-web 启动时出错:无法为 `brotli-sys v0.3.2` 运行自定义构建命令
问题描述
当我构建我的第一个 actix-web 测试时,我发现以下错误:
错误:无法运行自定义构建命令brotli-sys v0.3.2
怎么解决?
我的系统属性:
OS Name Microsoft Windows 10 Pro
Version 10.0.18363 Build 18363
System Type x64-based PC
Installed Physical Memory (RAM) 6.00 GB
终端:
PS C:\Users\Administrator\dev\rust_Lab\hello-world-actix> cargo run
Compiling cfg-if v0.1.10
Compiling lazy_static v1.4.0
Compiling futures-core v0.3.5
Compiling slab v0.4.2
Compiling futures-sink v0.3.5
Compiling winapi v0.2.8
Compiling bytes v0.5.6
Compiling once_cell v1.4.1
Compiling iovec v0.1.4
Compiling pin-project-lite v0.1.7
Compiling futures-io v0.3.5
Compiling pin-utils v0.1.0
Compiling smallvec v1.4.2
Compiling scopeguard v1.1.0
Compiling matches v0.1.8
Compiling tinyvec v0.3.4
Compiling copyless v0.1.5
Compiling adler v0.2.3
Compiling itoa v0.4.6
Compiling percent-encoding v2.1.0
Compiling either v1.6.1
Compiling ppv-lite86 v0.2.9
Compiling gimli v0.22.0
Compiling fnv v1.0.7
Compiling match_cfg v0.1.0
Compiling rustc-demangle v0.1.16
Compiling object v0.20.0
Compiling quick-error v1.2.3
Compiling widestring v0.4.2
Compiling linked-hash-map v0.5.3
Compiling regex-syntax v0.6.18
Compiling hashbrown v0.9.0
Compiling cpuid-bool v0.1.2
Compiling dtoa v0.4.6
Compiling opaque-debug v0.3.0
Compiling base64 v0.12.3
Compiling mio-uds v0.6.8
Compiling mime v0.3.16
Compiling language-tags v0.2.2
Compiling instant v0.1.7
Compiling tracing-core v0.1.16
Compiling thread_local v1.0.1
Compiling futures-channel v0.3.5
Compiling futures-task v0.3.5
Compiling bytestring v0.1.5
Compiling lock_api v0.4.1
Compiling unicode-bidi v0.3.4
Compiling unicode-normalization v0.1.13
Compiling http v0.2.1
Compiling lru-cache v0.1.2
Compiling addr2line v0.13.0
Compiling winapi v0.3.9
Compiling memchr v2.3.3
Compiling log v0.4.11
Compiling libc v0.2.77
Compiling proc-macro-nested v0.1.6
Compiling bitflags v1.2.1
Compiling getrandom v0.1.15
Compiling typenum v1.12.0
Compiling idna v0.2.0
Compiling brotli-sys v0.3.2
error: failed to run custom build command for `brotli-sys v0.3.2`
Caused by:
process didn't exit successfully: `C:\Users\Administrator\dev\rust_Lab\hello-world-actix\target\debug\build\brotli-sys-c17dbe422e853792\build-script-build` (exit code: 1)
--- stdout
cargo:include=C:\Users\Administrator\.cargo\registry\src\github.com-1ecc6299db9ec823\brotli-sys-0.3.2\brotli/include
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 14.0\\VC\\bin\\amd64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "brotli/include" "-FoC:\\Users\\Administrator\\dev\\rust_Lab\\hello-world-actix\\target\\debug\\build\\brotli-sys-924a6a49d6a39ff4\\out\\brotli/common/dictionary.o" "-c" "brotli/common/dictionary.c"
dictionary.c
brotli/common/dictionary.c: fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\cxxfe\sl\p1\c\p0io.c', line 2739)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
exit code: 2
--- stderr
fatal: not a git repository (or any of the parent directories): .git
error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "brotli/include" "-FoC:\\Users\\Administrator\\dev\\rust_Lab\\hello-world-actix\\target\\debug\\build\\brotli-sys-924a6a49d6a39ff4\\out\\brotli/common/dictionary.o" "-c" "brotli/common/dictionary.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
解决方案
经过一番研究,我确实找到了解决此错误的方法。
通过在区域设置中禁用“测试版:使用 Unicode UTF-8 获得全球语言支持”解决了问题。
这暗示了致命错误 C1001:编译器中发生了内部错误。'f:\dd\vctools\compiler\cxxfe\sl\p1\c\p0io.c',根据https://superuser.com/questions/1033088/is-it-possible-to-set-locale-of -a-windows-application-to-utf-8/1451686#1451686。
推荐阅读
- android - kotlin if else 语句
- android - Android 单行字幕 textview 性能
- sas - 查找数据排序逻辑
- erlang - 给予主管重启策略的名称的解释是什么?
- ios - UICollectionview 不通过 selectItem 功能 IOS 滚动到项目
- python - Python:接受多个可选参数的图形函数
- google-cloud-platform - 为 Google Speech API 指定区域?
- symfony - 如何从 Symfony4 中的数据库加载翻译?
- javascript - PHP (web) 导出到 power point (pptx)
- java - 使用字符数组反转字符串