|
can't compile after installing |
o______o
Member #16,628
January 2017
|
im new to allegro and also compiling with gcc 1#include <allegro5/allegro.h>
2#include <allegro5/allegro_primitives.h>
3
4int main(int argc, char **argv) {
5 int res[2] = {640, 480};
6 ALLEGRO_DISPLAY *scr;
7 al_init();
8 if (! al_init_primitives_addon())
9 return 1;
10 scr = al_create_display(res[0], res[1]);
11 al_clear_to_color(al_map_rgb(0, 36, 86));
12 al_draw_circle(res[0]/2, res[1]/2, res[1]/4, al_map_rgb(238, 237, 240), 5);
13 al_flip_display();
14 while (1);
15 return 0;
16}
using this line: /tmp/cc5C6cqP.o: In function `main': allegro_1.c:(.text+0x3d): reference to `al_install_system' not defined allegro_1.c:(.text+0x42): reference to `al_init_primitives_addon' not defined allegro_1.c:(.text+0x75): reference to `al_create_display' not defined allegro_1.c:(.text+0x8d): reference to `al_map_rgb' not defined allegro_1.c:(.text+0xba): reference to `al_clear_to_color' not defined allegro_1.c:(.text+0xce): reference to `al_map_rgb' not defined allegro_1.c:(.text+0x141): reference to `al_draw_circle' not defined allegro_1.c:(.text+0x146): reference to `al_flip_display' not defined collect2: error: ld returned 1 exit status
i have no idea what is the problem here |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You need to link with the allegro libraries that you are using. On Linux, you do this with pkg-config. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
o______o
Member #16,628
January 2017
|
finally i found i should do like this: |
|