|
Cannot compile simple allegro prog |
HaitiBoy
Member #11,060
June 2009
|
Hello, %% sudo port install allegro I am trying to write a simple program from Allegro tutorial. I have just main.cpp. Here is the code: #include <allegro.h> int main(){ END_OF_MAIN(); I do not use XCode or Eclipse. I use Smultron. To compile I have tried this: %% g++ -o main main.cpp Anyway I get this: main.cpp:1:21: error: allegro.h: No such file or directory Any help is appreciated. Thanks |
Arthur Kalliokoski
Second in Command
February 2005
|
I believe your -I option is supposed to point to the path where allegro.h is. [EDIT] They all watch too much MSNBC... they get ideas. |
Thomas Fjellstrom
Member #476
June 2000
|
Ok, you actually want to compile like so: g++ -o main main.cpp `allegro-config --libs` Notice those are backticks (`) not single quotes ('). That said, -L is to tell gcc which folder to add to the linker path (where to look for libraries), and -l is to add lib to link to: -lsomelib -- |
HaitiBoy
Member #11,060
June 2009
|
ok, %% g++ -o main main.cpp `allegro-config --libs` I got the same thing. Thanks for your help |
Trent Gamblin
Member #261
April 2000
|
Did you build allegro? Did you run "make install" afterwards?
|
OnlineCop
Member #7,919
October 2006
|
MacPorts does NOT install the header files from my experiences. It installs the libraries only (to run others' precompiled games). You will actually need to download and install allegro's sources yourself and compile them. I tried MacPorts to do the same thing. It failed.
|
HaitiBoy
Member #11,060
June 2009
|
Thanks guys, I have uninstalled MacPorts version of Allegro and installed version from the web site and it works! Thanks for your help. |
|