|
How to link allegro to GNUCC mac? |
DrZoidberg5
Member #15,446
January 2014
|
Hi! I tried to use allegro on mac with the GNU CC compiler, in the terminal. I followed the steps on the README_make.txt file, but it doesn't work. ¿What should i do? PS.: Forgive my bad english. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Post your results by pasting into a <pre>...</pre> block or <code>...</code> block. We can't help if we don't know what the errors are. Also, post the steps that you followed that worked, and what didn't work. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
DrZoidberg5
Member #15,446
January 2014
|
Yeah, sorry, now I tried it a second time a it seemed like it worked. 1#include <stdio.h>
2#include <allegro5/allegro.h>
3
4int main(int argc, char **argv){
5
6 ALLEGRO_DISPLAY *display = NULL;
7
8 if(!al_init()) {
9 fprintf(stderr, "failed to initialize allegro!\n");
10 return -1;
11 }
12
13 display = al_create_display(640, 480);
14 if(!display) {
15 fprintf(stderr, "failed to create display!\n");
16 return -1;
17 }
18
19 al_clear_to_color(al_map_rgb(0,0,0));
20
21 al_flip_display();
22
23 al_rest(10.0);
24
25 al_destroy_display(display);
26
27 return 0;
28}
I tried to compile it but i got this error: gcc mygame.c -o mygame $(pkg-config --libs allegro-5 allegro_image-5) Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.6.o (maybe you meant: __al_mangled_main) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
I believe on OSX you need to link to allegro_main. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
DrZoidberg5
Member #15,446
January 2014
|
Well, that worked, I should claim my stupidity price xD. |
|