LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Allegro probs -- I have rtfmed (https://www.linuxquestions.org/questions/programming-9/allegro-probs-i-have-rtfmed-126773/)

CamelofCamelot 12-17-2003 06:14 PM

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.

teval 12-21-2003 10:48 PM

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()

:)

deiussum 12-22-2003 08:34 AM

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)


All times are GMT -5. The time now is 08:56 AM.