LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-27-2005, 11:00 PM   #1
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Rep: Reputation: 30
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.
 
Old 11-28-2005, 01:39 AM   #2
nifund9
Member
 
Registered: Oct 2004
Distribution: Slackware 12.1, FreeBSD 7.0, UbuntuStudio 8.10
Posts: 32

Rep: Reputation: 15
Just to make sure Allegro

Last edited by nifund9; 11-28-2005 at 01:40 AM.
 
Old 11-28-2005, 10:49 AM   #3
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Yes
 
Old 11-28-2005, 07:59 PM   #4
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
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..
 
Old 11-29-2005, 01:48 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.

Last edited by Nylex; 11-29-2005 at 01:51 AM.
 
Old 11-29-2005, 02:06 AM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
>> 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Compile Cpp Source And Header? kike_coello Programming 10 09-08-2005 03:22 AM
How do I compile a *.cpp Document in linux? njbrain Linux - Software 9 01-29-2004 07:43 PM
compile programs in c and cpp Manjula.S Linux - Software 2 10-15-2003 01:06 AM
For some reason I can't compile a .cpp file with kdevelop, the button is greyed out. Manyguns Programming 1 07-16-2001 10:27 AM
to compile cpp on linux mandrake manpreet Programming 1 04-26-2001 12:45 AM


All times are GMT -5. The time now is 02:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration