Cannot launch SDL2 app on wsl2 using VcXsrv

I'm trying to run SDL2 window app in CLion on wsl2 (ubuntu 20) however facing these issues.

error: XDG_RUNTIME_DIR not set in the environment.
The path /dev/dri/ cannot be opened or is not available

I'm using VcXsrv for remote display which works fine when running the executable from terminal.
However running in Clion doesn't. So I'm looking for some way around it (if possible)

2

Please sign in to leave a comment.