运行 yarn tauri dev 报错:
yarn run v1.22.22
$ /data/code/test/tauri-app2/node_modules/.bin/tauri dev
Running BeforeDevCommand (`yarn dev`)
$ vite
VITE v6.0.7 ready in 69 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Info Watching /data/code/test/tauri-app2/src-tauri for changes...
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
/data/code/test/tauri-app2/src-tauri/target/debug/app: /home/liam/anaconda3/envs/pointfoot_legged_gym/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0)
/data/code/test/tauri-app2/src-tauri/target/debug/app: /home/liam/anaconda3/envs/pointfoot_legged_gym/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0)
/data/code/test/tauri-app2/src-tauri/target/debug/app: /home/liam/anaconda3/envs/pointfoot_legged_gym/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libicuuc.so.70)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
或者一下错误:
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
error: could not compile `tauri-app` (bin "tauri-app") due to 1 previous error
1. 临时禁用 Anaconda 环境中的 libstdc++
确保系统使用的是正确版本的 libstdc++
,并避免 Anaconda 环境中的 libstdc++
干扰。可以临时将 LD_LIBRARY_PATH
设置为系统默认的库路径:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH