Allegro in Ubuntu: undefined reference to `al_install_system'

前端 未结 2 964
谎友^
谎友^ 2020-12-04 01:01

I tried installing the Allegro library today. I have same experience in C++, but it seems I have none in doing stuff like that. I have compiled Allegro 5.0 from source and p

相关标签:
2条回答
  • 2020-12-04 01:15

    Allegro 5 uses pkg-config.

    gcc foo.c -o foo $(pkg-config --libs allegro-5.0)
    

    You will also need to specify addon libraries that you use:

    gcc foo.c -o foo $(pkg-config --libs allegro-5.0 allegro_image-5.0)
    
    0 讨论(0)
  • 2020-12-04 01:33

    You need to link with the Allegro libraries, but you don't seem to do so.

    allegro-config --libs returns nothing.

    There's part of your problem. Normally, you should be able to add it to your command line, like so:

    g++ `allegro-config --libs` test2.cc -o test2
    

    On my system (Ubuntu 10.10) it gives this:

    $ allegro-config --libs
    -L/usr/lib -Wl,-Bsymbolic-functions -lalleg-4.2.2
    

    Are you invoking the right allegro-config? Maybe you should specify the full path to it?

    0 讨论(0)
提交回复
热议问题