I have the following code from a tutorial and i am trying to compile it on a mac using g++/gcc however every time it complains about the native dialog but i am referencing the library correctly i think
#include<allegro5/allegro.h>
#include<allegro5/allegro_native_dialog.h>
int main()
{
ALLEGRO_DISPLAY *display;
if(al_init())
al_show_native_message_box(NULL, NULL, "Error", "Could not initialize Allegro 5", NULL, ALLEGRO_MESSAGEBOX_ERROR);
display = al_create_display(800, 600);
if(!display)
al_show_native_messagebox(NULL, NULL, "Error", "Could not create Allegro 5 display", NULL, ALLEGRO_MESSAGEBOX_ERROR);
al_destroy_display(display);
return 0;
}
The error i get is
main.cpp: In function ‘int _al_mangled_main()’:
main.cpp:17: error: ‘al_show_native_messagebox’ was not declared in this scope
And the command i use is
g++ -o main main.cpp -lallegro -lallegro_main -lallegro_native_dialog
I have also tried with
g++ -o main main.cpp -lallegro -lallegro_main -lallegro_dialog
Any help would be great.
Thanks