Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Errors after installing on Mac

This thread is locked; no one can reply to it. rss feed Print
Errors after installing on Mac
Andrew Gillett
Member #15,868
January 2015

I was tutoring a student in game development and we tried to install Allegro on his Mac (latest OS).

We followed the instructions here https://github.com/liballeg/allegro_wiki/wiki/Quickstart

The following errors were output when trying to compile the example program:

192:C++ tommymurf$ gcc hello.c -o hello $(pkg-config allegro-5 allegro_main-5 allegro_font-5 --libs --cflags)
-bash: pkg-config: command not found
./hello

Undefined symbols for architecture x86_64:
"_al_clear_to_color", referenced from:
__al_mangled_main in hello-98b234.o
"_al_create_builtin_font", referenced from:
__al_mangled_main in hello-98b234.o
"_al_create_display", referenced from:
__al_mangled_main in hello-98b234.o
"_al_create_event_queue", referenced from:
__al_mangled_main in hello-98b234.o
"_al_create_timer", referenced from:
__al_mangled_main in hello-98b234.o
"_al_destroy_display", referenced from:
__al_mangled_main in hello-98b234.o
"_al_destroy_event_queue", referenced from:
__al_mangled_main in hello-98b234.o
"_al_destroy_font", referenced from:
__al_mangled_main in hello-98b234.o
"_al_destroy_timer", referenced from:
__al_mangled_main in hello-98b234.o
"_al_draw_text", referenced from:
__al_mangled_main in hello-98b234.o
"_al_flip_display", referenced from:
__al_mangled_main in hello-98b234.o
"_al_get_display_event_source", referenced from:
__al_mangled_main in hello-98b234.o
"_al_get_keyboard_event_source", referenced from:
__al_mangled_main in hello-98b234.o
"_al_get_timer_event_source", referenced from:
__al_mangled_main in hello-98b234.o
"_al_install_keyboard", referenced from:
__al_mangled_main in hello-98b234.o
"_al_install_system", referenced from:
__al_mangled_main in hello-98b234.o
"_al_is_event_queue_empty", referenced from:
__al_mangled_main in hello-98b234.o
"_al_map_rgb", referenced from:
__al_mangled_main in hello-98b234.o
"_al_register_event_source", referenced from:
__al_mangled_main in hello-98b234.o
"_al_start_timer", referenced from:
__al_mangled_main in hello-98b234.o
"_al_wait_for_event", referenced from:
__al_mangled_main in hello-98b234.o
"_main", referenced from:
implicit entry/start for main executable
(maybe you meant: __al_mangled_main)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Andrew Gillett
Member #15,868
January 2015

Is pkg-config something that can be installed as a dependency when running brew install allegro, or does it have to be installed separately? We hadn't installed pkg-config because we had never heard of it before and the tutorial didn't mention it.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

pkg-config is not a dependency of allegro, therefore won't install when you install allegro.

pkg-config is simply a program that stores the different compiler and linker flags you need to build a program with allegro. You can set the compiler and linker flags manually, but I have no experience doing so on a Mac.

Just google pkg-config and install it, then reinstall allegro and it should pick it up.

Peter Hull
Member #1,136
March 2001

You do need to install pkg-config and you can get it from Homebrew. I've updated the wiki.

Go to: