|
How do I use Allegro? |
xix131
Member #16,556
September 2016
|
Hi, I simply want to get started in Allegro by testing to see if things are working. I want to make a simple program like on https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays to test it out. I have simply copy-pasted it out and here is my problem. I am familiar with very basic C compiling in the command line. I know how to code python, c and c# on a basic level. I am on a Mac. I usually run make ___.c and understand simple use of gcc and ./outputObject . However, already on the first line of my program (probably the most crucial line), running gcc I get the error that I had the file called al.c, ran gcc al.c and gave that error I tried to do the best I could to set up Allegro but all I know is (I think) I have installed the library files in my usr/local/lib directory. tl;dr I'm stuck trying to compile my first program. What do I need to fix? Thanks in advance for any help <3 |
Audric
Member #907
January 2001
|
Hi and welcome! I'm not an OSX user, but you can check if you have a /usr/local/include directory. If you don't quickly find your answers, you may want to remove the files that you put, then try the following method: |
xix131
Member #16,556
September 2016
|
Hi again, I think I have sorted out a few things and have ran into a new problem. I think this one is easier to solve (perhaps). I try compiling using : and now I am no longer getting errors about including the allegro.h file. But, now I am getting errors in linking: Quote:
Undefined symbols for architecture x86_64: What have I done and how do I fix this? |
Audric
Member #907
January 2001
|
I think it's because you didn't link allegro_main in addition to allegro Order of linking is important, so be sure to write -lallegro -lallegro_main |
xix131
Member #16,556
September 2016
|
Hi, I think I am getting closer and closer. Still getting an error though, Quote: ld: library not found for -lallegro What would cause this error??? |
Audric
Member #907
January 2001
|
xix131 said: (I think) I have installed the library files in my usr/local/lib directory.
What files (names) did you copy there ? Do they have the same extensions as what was already there ? |
|