Hello, Im having difficulties getting allegro to work on iOS.
At first I tried following the instructions included in README_iphone, but running cmake gave me lots of warnings about libraries not being installed, even though homebrew says they are.
So, I gave a try to the pre-built project. It compiled and generated an .a file.
Then I created a new xcode project using the single view application template with objective-c, and set the directories for the allegro headers and the library file.
I made a simple c++ function and called it inside ViewController/ViewDidLoad and it works fine.
Now for the allegro part, adding any allegro function call like al_init results in the following compiler error:
How to proceed?
For various reasons Allegro needs to hijack your main. This can be handled transparently by the main addon, but for whatever reason it appears not to be working. Whenever this is an issue, you can always do the following:
#define ALLEGRO_NO_MAGIC_MAIN #include <allegro5/allegro.h> int real_main(int argc, char** argv) { al_init(); ... } int main(int argc, char** argv) { return al_run_main(argc, argv, real_main); }
Also,
but running cmake gave me lots of warnings about libraries not being installed, even though homebrew says they are.
This is because homebrew installs things that are compiled for your MacOS/OSX, but not for iOS. Generally that means having to compile the dependencies yourself, and we also provide somewhat outdated pre-compiled versions here: http://liballeg.org/download.html#iphone.
After doing exactly like your code the project now compiles 
Ok, I started writing a small program to see if everything is working fine. After a few minutes I ran in some compiler errors again.
My main.mm now look like this:
See the 4 commented lines at the init section: These calls are producing a long list of compiler errors just like the one on the first post "Undefined symbols for architecture x86_64: blah blah blah referenced from:"
It probably makes sense for TTF addon to be missing, as you probably don't have the correct freetype, but strange that you're missing the other ones. Are you using the... pre-made XCode project? I'm not super familiar with it.
I used the project included in misc/Allegro5_iOS to generate the library file.
Is it necessary to manually compile/install the dependencies in order for that project to work correctly?
Edit:
I'm trying the cmake method again. Downloaded the 3 pre-compiled dependencies you mentioned and put the content inside "deps" folder, but it doesn't seen cmake is making any use of the content there at all.
I run the following command:
cmake -DCMAKE_TOOLCHAIN_FILE=allegro-5.2.3.0/cmake/Toolchain-iphone.cmake -G Xcode \ -DIOS_PLATFORM="iphoneos" -DWANT_EXAMPLES=off -DWANT_DEMO=off -DWANT_TESTS=off -DWANT_PHYSFS=no allegro-5.2.3.0
Then the terminal shows:
Any ideas?
Bumping the thread to prevent the lock. I'll take a look this weekend at what the status of this is.
EDIT: So I tried this, and indeed, aside from physfs, it didn't appear that the deps worked. The errors looked like versions mismatches, so perhaps if the dependencies are rebuilt, it'd work fine. What I'll do next is follow directions outlined here: https://wiki.allegro.cc/index.php?title=IOS_and_Allegro_5 (with updated paths) and see if I can get it working.