Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Error in Build in Cartpole Example due to sdl2-gfx #11

Open
yunho-c opened this issue Apr 5, 2024 · 3 comments
Open

[Linux] Error in Build in Cartpole Example due to sdl2-gfx #11

yunho-c opened this issue Apr 5, 2024 · 3 comments

Comments

@yunho-c
Copy link

yunho-c commented Apr 5, 2024

Hi, I encountered a few errors in building the cartpole example.

I was able to get them sorted out, but still making this issue to document. Things I had to do to solve:

  • Install cmake (sudo apt install cmake)
    • This was a fresh installation that didn't happen to have cmake installed, which is unlikely, yet possible for beginners/students
  • Add the following lines to cargo.toml (not sure if this is strictly required... but nonetheless resolved an error)
    • and run cargo vcpkg build before cargo build
[package]
name = "gym-rs"
...

[dependencies]
...

+ [package.metadata.vcpkg]
+ dependencies = ["sdl2", "sdl2-gfx"]
+ git = "https://github.com/microsoft/vcpkg"
+ rev = "501db0f" # or change based on the latest release in GitHub
  • Install libsdl2-gfx-dev in addition to libsdl2-dev
    • I feel that other users may encounter the same issue; perhaps would be good to update readme

Thanks for making this awesome library! Feel free to investigate more or close the issue.

@benbaarber
Copy link
Contributor

I had the same issue with /usr/bin/ld: cannot find -lSDL2_gfx: No such file or directory. Running sudo apt install libsdl2-gfx-dev fixed it for me, personally I did not need to add anything from the second bullet. Thank you for documenting this!

@GDur
Copy link

GDur commented Nov 7, 2024

Would be nice if someone would implement it using macroquad instead of sdl2. ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants