|
Xcode setup |
slycoder
Member #17,113
August 2019
|
I'm getting a crash when I launch my test app. I feel like its a config error but I'm not sure. I installed allegro with homebrew as suggested on the wiki. See below screenshots. https://ibb.co/tDvJpRp dyld: Symbol not found: __al_mangled_main 1#include <iostream>
2#include <allegro5/allegro.h>
3
4int main(int argc, const char * argv[]) {
5
6 ALLEGRO_DISPLAY *mainDisplay = NULL;
7
8 al_init();
9
10 mainDisplay = al_create_display(600, 800);
11
12 al_clear_to_color(al_map_rgb(255, 0, 0));
13
14 al_flip_display();
15
16 al_rest(10);
17
18 al_destroy_display(mainDisplay);
19
20 // insert code here...
21 std::cout << "Hello, World!!\n";
22 return 0;
23}
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
You need to link to allegro main, the addon. 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 |
slycoder
Member #17,113
August 2019
|
Is this different than the one in my first screenshot? |
Peter Hull
Member #1,136
March 2001
|
Is your prog C++? - if so you have to be careful about your definition of main().
|
slycoder
Member #17,113
August 2019
|
@Peter That worked! And yes, it is c++. Do you know why it's so picky about the main args? I've never had an issue with any particular main args. These args were generated by the Xcode project template. |
Peter Hull
Member #1,136
March 2001
|
It's something to do with mangling; Allegro #defines main to be _al_mangled_main and calls it from the real main which is in the addon. With C++, if you don't have the right types for your args, the symbol gets exported as __Z16_al_mangled_mainiPPKc so the linker can't find it.
|
|