Allegro native dialogues not recognized

霸气de小男生 提交于 2019-12-13 06:43:09

问题


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.


回答1:


It's -lallegro_dialog not -lallegro_native_dialog!



来源:https://stackoverflow.com/questions/14249456/allegro-native-dialogues-not-recognized

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!