I'm trying to create a small game using Allegro. I've already downloaded the library and it is now on usr/include/allegro
. When I'm trying to compile I get:
/usr/bin/ld: /tmp/ccvQ9fiI.o: in function `main':
first_test.c++:(.text+0x1d): undefined reference to `al_install_system'
/usr/bin/ld: first_test.c++:(.text+0x22): undefined reference to `al_init_font_addon'
/usr/bin/ld: first_test.c++:(.text+0x31): undefined reference to `al_create_display'
/usr/bin/ld: first_test.c++:(.text+0x3a): undefined reference to `al_create_builtin_font'
/usr/bin/ld: first_test.c++:(.text+0x52): undefined reference to `al_map_rgb'
/usr/bin/ld: first_test.c++:(.text+0x78): undefined reference to `al_clear_to_color'
/usr/bin/ld: first_test.c++:(.text+0x8c): undefined reference to `al_map_rgb'
/usr/bin/ld: first_test.c++:(.text+0xd5): undefined reference to `al_draw_text'
/usr/bin/ld: first_test.c++:(.text+0xda): undefined reference to `al_flip_display'
collect2: error: ld returned 1 exit status
The thing is I've included correctly the library, it seems like the compiler could not find the library. How can I fix that? I also get a problem with limit.h
, it also seems missing for the compiler (libc6-dev is installed)
I'm using vs-code with c++ on Ubuntu for the first time. Did I miss something?
I've tried including manually the library. No way.
I've tried with
#inlcude "/usr/include/allegro5/allegro.h"