![]() |
|
Installing Allegro on Mac (OS X 10.9.5) Allegro 5.0.11 |
Smartypants
Member #15,897
March 2015
|
----- And it worked. I am not sure how so please feel free to explain Hello! I followed to steps to build and install Allegro 5 from their wiki (found here: https://wiki.allegro.cc/index.php?title=Main_Page) and seemingly succeeded with no problems. allegro was installed to the following (as the wiki suggests) /usr/local/include and usr/local/lib and I have confirmed allegro is there. I then wrote the following code in vim: #include <stdio.h> int main(int argc, char **argv) if(!al_init()) display = al_create_display(640, 480); if(!display) al_clear_to_color(al_map_rgb(0,0,0)); return 0; I am new to using Unix and have only ever compiled c++ programs with g++ that were simple hello world files with no libraries needed. Therefore after searching around on the internet I tried the following commands: g++ hello.cpp -o hello `pkg-config --libs allegro-5` resulting in the following: Undefined symbols for architecture x86_64: BTW, I used homebrew to install dependencies instead of macports brew install pkg-config brew install zlib etc... I think its a problem with things not being linked. What am I doing wrong? |
Elias
Member #358
May 2000
|
Smartypants said: And it worked. I am not sure how so please feel free to explain There's several libraries which you all need to link to: allegro_main, allegro, allegro_image, allegro_primitives, allegro_color, allegro_font, allegro_ttf, allegro_audio, allegro_acodec, allegro_memfile, allegro_physfs, allegro_native_dialog You forgot the first one at first (which is technically required everywhere but in practice only on OSX). Or you can build Allegro with the "monolith" option, then you will only have a single library with everything: allegro_monolith -- |
|