e-tipsmemo

ごった煮

Rust Build Windows DLL on WSL 2

e-tipsmemo.hatenablog.com
このような記事を書いたが、

.cargo/configの記述がこのままだと
i686-pc-windows-gnuコンパイルすると、

C:\projects\rust\src/libpanic_unwind/gcc.rs:292: undefined reference to `_Unwind_Resume'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `hello`.

というエラーがでるのを忘れていた。

このエラーに対する解決策は、
Rustでクロスコンパイルしてみた | 思案試行
のブログより、

.cargo/config
の記述に追加する。

[target.i686-pc-windows-gnu]
linker = "/usr/bin/i686-w64-mingw32-gcc"
rustflags = "-C panic=abort"