我正在尝试使用货物构建一个项目,这是我收到的以下错误
= note: /usr/bin/ld: /home/probot/dappicom/emulator/target/debug/deps/libsdl2-e3367154734f8b05.rlib(sdl2-e3367154734f8b05.sdl2.6bee403e1d2a37b8-cgu.07.rcgu.o): in function `sdl2::url::open_url':
/home/probot/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sdl2-0.35.2/src/sdl2/url.rs:65: undefined reference to `SDL_OpenURL'
collect2: error: ld returned 1 exit status
= 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#cargorustc-link-libkindname)
error: could not compile `tetanes` (bin "tetanes") due to 1 previous error
我尝试了这里给出的解决方案同样的错误但它不起作用。
我根据此解决方案更改了库路径错误,但在macOS上它也不起作用。
预期:
货物建造成功。
我做了什么
这些是我运行的命令。
sudo apt-get update
sudo apt-get install libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev
echo 'export LIBRARY_PATH="$LIBRARY_PATH/usr/local/lib"' \>\> \~/.bash_profile
source \~/.bash_profile
将 sdl2 版本更新到 2.0.14 或更高版本可以解决该问题 检查您的版本
sdl2-config --version