LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to compile a C++ file (.cpp) with allegro? (http://www.linuxquestions.org/questions/programming-9/how-to-compile-a-c-file-cpp-with-allegro-387152/)

RHLinuxGUY 11-27-2005 11:00 PM

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.

nifund9 11-28-2005 01:39 AM

Just to make sure Allegro

RHLinuxGUY 11-28-2005 10:49 AM

Yes

xhi 11-28-2005 07:59 PM

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..

Nylex 11-29-2005 01:48 AM

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.

xhi 11-29-2005 02:06 AM

>> 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 12:34 AM.