簡體   English   中英

在 Linux 上安裝 SDL2

[英]Installing SDL2 on Linux

我嘗試從 Twinklebar SDL 教程中運行簡單的 test.cpp,出現此錯誤:

test.cpp:2:10: fatal error: 'SDL2/SDL.h' file not found

於是我在 Ubuntu/Mint 中查找 sdl 開發包:

aptitude search sdl | grep 2

我能找到的只有這個:

libsdl1.2-dev

這是否意味着我唯一的選擇是從源代碼安裝?

這取決於您運行的是哪個 Ubuntu 版本,但是是的,Ubuntu 有一個 libsdl2 包: http ://packages.ubuntu.com/search?keywords=sdl2

你想要的包叫做libsdl2-dev

此外,關於#include <SDL/SDL.h>行,似乎推薦的方法是調整編譯器標志以添加 SDL 的包含 pah 並使用#include "SDL.h" 有關更多詳細信息,請參閱https://forums.libsdl.org/viewtopic.php?t=5997

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM