HackerFoxBlog

导航

rust编译驱动

  1. 下载rust安装包,运行,选1自动安装
    https://www.rust-lang.org/zh-CN/tools/install
  2. cargo install --force cargo-make
  3. 安装vs2022,好像至少2019,勾选 sdk26100版本
  4. 下载安装wdk26100,会自动安装kmdf1.33
  5. 下载安装clang,64位
    https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.8
    然后去执行rust编译,就ok了

可能的报错:

  1. Error: cannot find directory: C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\km/crt
    wdk版本太低
  2. Error: cannot find directory: C:\Program Files (x86)\Windows Kits\10\Include\wdf/kmdf/1.33
    wdk版本太低
  3. Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'],
    set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])"
    note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
    安装clang,配置 LIBCLANG_PATH 环境变量
    LIBCLANG_PATH:D:\Program Files (x86)\LLVM\bin
  4. C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\km\crt\crtdefs.h:67:10: fatal error: 'specstrings.h' file not found
    sdk版本太低
  5. BufferOverflowFastFailK.lib(loadcfg.obj) : error LNK2001: 无法解析的外部符号 __guard_eh_cont_table
    vs2017 + 不匹配的26100的环境,就会出这个,要升级vs

posted on 2024-09-04 11:25  HackerFox  阅读(319)  评论(0)    收藏  举报