Home > Blockchain >  XCode12 Allegro "file not found"
XCode12 Allegro "file not found"

Time:10-16

I could use some help solving a linker error. Could just be because I'm new to developing for MacOS. I got my Allegro Libraries off of Homebrew by using brew install allegro. I followed the steps on the tutorial I watched nearly to a tee, as I opened XCode to make a Cocoa app, went to the target, edited my build settings, and changed my Header search path to /usr/local/include/** and my Library search path to /usr/local/lib/**, as well as set my Framework search path to /Library/Frameworks/**. I set my C dialect to GNU 11. I went back into my terminal, where I used the commands to pull up my Allegro libraries in the Cellar. I picked out all the necessary files to make the game work, and then drag n' dropped them all into my linked frameworks and libraries. I created a Copy Files build phase with a destination of my frameworks, and drag n' dropped those same Allegro files into it as folder references as shown here: My files After all that, it was time to create my main.cpp.

#include <stdio.h>
#include <vector>
#include <allegro5\allegro.h>
#include <allegro5\allegro_font.h>
#include <allegro5\allegro_acodec.h>
#include <allegro5\allegro_audio.h>
// ...

...and there in laid the problem. I had gotten the error: 'allegro5\allegro.h' file not found. Upon double checking by commenting out the troublesome lines, it had turned out none of the files I #included could be found. Is there some kind of step I'm missing?

CodePudding user response:

Well that was weird. I ran the code and suddenly all the errors went away. XCode can be so weird sometimes.

  • Related