Tauri编译报错Warning: .drectve `-exclude-symbols:“_ZN4core3ptr78drop_in_place$LT$windows..Windows..Win32

npm run tauri dev运行时报这个错:

Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h5f59b459b8765040E" ' unrecognized
          Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$8haystack17hafa926f860e6717fE" ' unrecognized
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          Warning: corrupt .drectve at end of def file
          collect2.exe: error: ld returned 5 exit status


error: could not compile `tauri-app` (bin "tauri-app") due to previous error

原因:
rust环境不对,我的环境是mingw,应该换MSVC

# 查看 rust环境 看host属性
rustc --version --verbose

如果要切换,执行(我选择了重装

rustup default stable-msvc

你可能感兴趣的:(windows,rust)