Rust应该怎么导入 #263
-
复现步骤: cargo new maa_xxx Cargo.toml [package]
name = "maa_xxx"
version = "0.1.0"
edition = "2021"
[dependencies]
maa-framework = "0.5.0" cargo run
Caused by:
process didn't exit successfully: `xxx\target\debug\build\maa-framework-da8f69a5e0001d68\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=./cmake/CMakeLists.txt
--- stderr
thread 'main' panicked at xxx\rust\cargo_home\registry\src\index.crates.io-6f17d22bba15001f\maa-framework-0.5.0\build.rs:19:9:
Unable to find MaaFramework libraries
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
1: core::panicking::panic_fmt
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
2: std::rt::lang_start
3: std::rt::lang_start
4: __ImageBase
5: std::rt::lang_start
6: std::rt::lang_start_internal
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\rt.rs:141
7: std::rt::lang_start
8: main
9: invoke_main
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
10: __scrt_common_main_seh
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
11: BaseThreadInitThunk
12: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish.. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
你需要安装MaaFramework 推荐的方法是安装到你的本地。如果是Windows系统,解压最新版本的fw后将路径添加到CMake的search path中,具体方法查询CMake相关文档。最简单的方法是添加到PATH环境变量。 其次你可以添加maa_framework的download feature,会自动在构建时下载对应版本的fw,但这是不推荐的方法。 无论采取何种方法,最终的程序运行时都仍然需要fw的动态库。 |
Beta Was this translation helpful? Give feedback.
-
PATH环境变量已经添加win-x86_64.zip解压后的目录/bin Caused by: --- stderr |
Beta Was this translation helpful? Give feedback.
你需要安装MaaFramework
推荐的方法是安装到你的本地。如果是Windows系统,解压最新版本的fw后将路径添加到CMake的search path中,具体方法查询CMake相关文档。最简单的方法是添加到PATH环境变量。
其次你可以添加maa_framework的download feature,会自动在构建时下载对应版本的fw,但这是不推荐的方法。
无论采取何种方法,最终的程序运行时都仍然需要fw的动态库。