< 返回版块

chn-cutelotus 发表于 2020-11-17 17:34

最近做了个写入xlsx文件的测试程序,用了xlsxwriter这个crate cargo.toml: [dependencies] xlsxwriter={git="https://github.com/informationsea/xlsxwriter-rs"}

main.rs: fn main() { let workbook = Workbook::new(r"C:\Users\Lotus\Desktop\rust-xlsxwriter.xlsx"); let mut format1 = workbook.add_format() .set_font_color(FormatColor::Red);

let mut format2 = workbook.add_format()
.set_font_color(FormatColor::Blue)
.set_underline(FormatUnderline::Single);

let mut sheet1 = workbook.add_worksheet(None)?;
sheet1.write_string(0, 0, "Red text", Some(&format1))?;

}

编译的时候报错: warning: set the LLVM_CONFIG_PATH environment variable to the full path to a valid llvm-config executable (including the executable itself)

error: failed to run custom build command for libxlsxwriter-sys v1.0.0 (https://github.com/informationsea/xlsxwriter-rs#d698188a)

Caused by: process didn't exit successfully: D:\coding\Rust\xlsxwriter_test1\target\debug\build\libxlsxwriter-sys-4c8d19559e20da61\build-script-build (exit code: 101) --- stderr thread 'main' panicked at '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: [])"', C:\Users\Lotus.cargo\registry\src\crates.rustcc.com-a21e0f92747beca3\bindgen-0.54.0\src/lib.rs:1959:31
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

请教各位大神如何解决,感激不尽!

评论区

写评论
作者 chn-cutelotus 2020-11-18 12:55

感谢大神,已经解决。

OTOMariK 2020-11-17 19:46

下一个llvm,然后把LIBCLANG_PATH环境变量设为clang可执行文件的路径

heixiu580 2020-11-17 18:00

请问怎么联系

1 共 3 条评论, 1 页