我在 Windows 10 上使用 Ubuntu 20.04.3 WSL。我将我的 C++ 程序(使用 SDL2 库)编译为名为“main”的可执行文件。
g++ -o main main.cpp CApp.cpp -lSDL2 -std=c++17
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下命令运行可执行文件时:
./main
Run Code Online (Sandbox Code Playgroud)
它返回:
error: XDG_RUNTIME_DIR not set in the environment.
Run Code Online (Sandbox Code Playgroud)