0

I got allegro5 set up, and simple programs (like displaying a window, filling it with a black background) work fine. When I try importing other headers (like native dialogs) though, I run into problems. For example, when compiling this code

#include <allegro5/allegro.h>
#include <allegro5/allegro_native_dialog.h>

int main(){

   if(al_init()) {
      al_show_native_message_box(al_get_current_display(),
                                 "Window Title",
                                 "Content Title",
                                 "The error message here",
                                 NULL, ALLEGRO_MESSAGEBOX_ERROR);
      return 0;
   }

   return 0;
}

like so

g++ -L/usr/local/lib -L/usr/lib -o "Allegro" ./main.o -lallegro_main -lallegro

I get this error

Undefined symbols for architecture x86_64:
  "_al_show_native_message_box", referenced from:
      _al_mangled_main()     in main.o

Any idea who to fix this? I am positive all the header files exist, and there seem to be the proper libraries in /usr/local/libs.

EDIT: I also tried adding a -lallegro_native_dialog flag to g++ with no avail. Instead get an error saying library not found for -lallegro_native_dialog, saw the suggestion elsewhere and thought I'd give it a shot.

Puzzler3141
  • 1,682
  • 2
  • 14
  • 21
  • Allegro 5 has a number of optional components. Did you build those optional components? – Nicol Bolas Jan 10 '13 at 01:50
  • @NicolBolas The header file is in /usr/local/include/allegro5, does that mean it's built? When I did a cmake/make/make install I never did anything special, so that may be the case. – Puzzler3141 Jan 10 '13 at 01:57

1 Answers1

2

It's -lallegro_dialog not -lallegro_native_dialog!

Puzzler3141
  • 1,682
  • 2
  • 14
  • 21