LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-17-2003, 06:14 PM   #1
CamelofCamelot
Member
 
Registered: Aug 2003
Distribution: Slackware, ClusterKnoppix, Gentoo
Posts: 85

Rep: Reputation: 15
Allegro probs -- I have rtfmed


I have rtfmed, and I still can't seem to figure what's wrong w/ allegro (or me)...

I downloaded allegro source (*nix version) from allegro.cc to /tmp
then int the terminal...
# cd /tmp
# tar -zxvf ./allegroxxxxx.tar.gz
# cd ./allegroxxxx
# ./configure
# make
# make install
# make install-man
# make install-info

then in Nedit, I made a simple cpp file:
#include <allegro.h>
int main()
{
alleg_init();
return(0);
}

then in the terminal...
# g++ -o ./allegtest ./allegtest.cpp

allegtest.cpp: In function `int _mangled_main()':
allegtest.cpp:4: `alleg_init' undeclared (first use this function)
allegtest.cpp:4: (Each undeclared identifier is reported only once for each
function it appears in.)

I've also tried it w/out the alleg_init() thing, and it's pretty much the same (w/out the alleg init undeclared error)
That seems to be all the info I can give on my problems. I'm pretty damn sure I didn't get anything wrong in my simple c++ program, so it must be in the installation I guess. Thanks in advance for any help.
 
Old 12-21-2003, 10:48 PM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
It's not alleg_init() it's allegro_init()
It's in the manual

Straight from the online manual:

int main(void)
{
allegro_init();
/* more stuff goes here */
...
return 0;
}
END_OF_MAIN()

 
Old 12-22-2003, 08:34 AM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I'm not familiar with Alegro, but in general, when using libraries that are not part of the C/C++ standard library, you are going to need to add those libraries to your command line. (e.g. I'd try adding something like -lallegro) Also, if it's not in your standard library paths, you will need to include the path to it in your search paths. (e.g. -L/path/to/allegro/lib)

And if you are getting compile errors where it can't find the function definitions, it is possible your headers are not in the search path for headers. You fix this by including an option to add the path to your header to the header search path. (e.g. -I/path/to/allegro/include)

Last edited by deiussum; 12-22-2003 at 08:35 AM.
 
  


Reply



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
Error using C++, allegro and VS 2003 poeta_boy Programming 0 06-12-2005 11:11 PM
allegro + hex integers CamelofCamelot Programming 4 01-04-2004 09:56 AM
Allegro Trex005 Linux - General 6 09-06-2001 07:04 PM
HELP!: installing Allegro library playmesumch00ns Linux - Software 0 06-14-2001 02:52 PM
ESS Allegro-1 johncla Linux - Software 1 02-19-2001 11:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration