How to compile a C++ file (.cpp) with allegro?
I recently got a book "Game Programming All In One 2nd Edition" and it uses c as its language for the book. Now, from what I understand C++ is just an extention(s) to c, and wasn't anything that was to replace c. I understand this because I can use functions and commands used in c, much the same in c++. (such as textprintf). But I'm getting an error from the compiler saying that Allegro is not found...
george@linux:~/Documents> g++ class4.cpp -o class4 `allegro-config --libs` bash: allegro-config: command not found class4.cpp:4:21: allegro.h: No such file or directory class4.cpp:29:2: warning: no newline at end of file george@linux:~/Documents> ... I can use SDL and those are c based functions. Correct? If what I think is wrong, and I'm sure it is, please correct me with the right information. Thanx in advance. |
Just to make sure Allegro
|
Yes
|
their website says..
>> Allegro is a game programming library for C/C++ :) so you should be ok there. the error is saying that the header file cannot be found .. so you need to locate the header location and include it with -I/location/of/headers on the g++ line.. |
The "allegro-config: command not found" suggests that a. it isn't in his $PATH, or b. he doesn't have Allegro installed.
I've never used Allegro (in fact, I hadn't heard of it before now), but still, you might wanna check those things. |
>> The "allegro-config: command not found" suggests that a. it isn't in his $PATH, or b. he doesn't have Allegro installed.
I must be going blind.. ?? or illiterate. |
All times are GMT -5. The time now is 01:58 AM. |