Absolucy / Absolucy/nanorand-rs

I tried the example in the document, but it wouldn't compile!

Đang mở
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
251
Fork
24
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

```rust
use nanorand::{Rng, WyRand};

let mut rng = WyRand::new();
println!("Random number: {}", rng.generate::());
```
log
```
Running `C:\Users\Admin\scoop\shims\sccache.exe C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name random --edition=2024 src\main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=102 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values())" -C metadata=c81260ed2b3d825c --out-dir C:\Users\Admin\repos\try-rs\random\target\debug\deps -C incremental=C:\Users\Admin\repos\try-rs\random\target\debug\incremental -L dependency=C:\Users\Admin\repos\try-rs\random\target\debug\deps --extern nanorand=C:\Users\Admin\repos\try-rs\random\target\debug\deps\libnanorand-812c2cf660e27061.rlib`
error: linking with `link.exe` failed: exit code: 1120
|
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\Admin\\AppData\\Local\\Temp\\rustcD0fBFH\\symbols.o"
"<18 object files omitted>" "C:\\Users\\Admin\\repos\\try-rs\\random\\target\\debug\\deps/libnanorand-812c2cf660e27061.rlib" "\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libcfg_if-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "kernel32.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/OUT:C:\\Users\\Admin\\repos\\try-rs\\random\\target\\debug\\deps\\random.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:\\lib\\rustlib\\etc\\libstd.natvis"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: libnanorand-812c2cf660e27061.rlib(nanorand-812c2cf660e27061.nanorand.732d8b2c3b481fbd-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol SystemFunction036 referenced in function _ZN8nanorand7entropy7windows7entropy17h22f5209f19f3618eE␍
C:\Users\Admin\repos\try-rs\random\target\debug\deps\random.exe : fatal error LNK1120: 1 unresolved externals␍

error: could not compile `random` (bin "random") due to 1 previous error

Caused by:
process didn't exit successfully: `C:\Users\Admin\scoop\shims\sccache.exe C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name random --edition=2024 src\main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=102 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values())" -C metadata=c81260ed2b3d825c --out-dir C:\Users\Admin\repos\try-rs\random\target\debug\deps -C incremental=C:\Users\Admin\repos\try-rs\random\target\debug\incremental -L dependency=C:\Users\Admin\repos\try-rs\random\target\debug\deps --extern nanorand=C:\Users\Admin\repos\try-rs\random\target\debug\deps\libnanorand-812c2cf660e27061.rlib` (exit code: 1)
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

The error shows an unresolved external symbol `SystemFunction036` in the Windows entropy function. Look at `nanorand::entropy::windows::entropy` in the source code, likely in `src/entropy/windows.rs`. Investigate the linker issue on Windows, possibly missing a library like `advapi32.lib`. Check the build configuration and dependencies for Windows targets. Verify the fix by compiling the example on a Windows system or using CI.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.