我是 Allegro、Ubuntu 和 C++ 的新手……提前抱歉……
我刚刚安装了 Allegro 4。来自 ubuntu 软件管理器的东西。然后我按照此页面的说明安装 Allegro 5。我认为我的库链接不正确,但我不完全知道如何手动更改它。
我的代码:
#include <allegro.h> //the allegro 4 header?
#include <allegro/allegro5.h> //the allegro 5 header?
int main(){
allegro_init();
}
END_OF_MAIN()
我的编译行:
g++ allegro_test.cpp -o output.out `pkg-config --libs allegro5.0`
我的输出:
allegro_test.cpp (.text+0x2a) undefined refrence to '_install_allegro_check_version'
我认为它类似于这个问题,但我不知道如何链接库。我想让它自动知道。