Newbie help - program can't run correctly
habeas corpus

Hi! I'm new here, i'm just trying to begin with Allegro, and I have compiled an easy program:

1#include <allegro.h>
2 
3using namespace std;
4 
5int main(){
6 
7 allegro_init();
8 install_keyboard();
9 set_gfx_mode(GFX_AUTODETECT , 640, 480, 0, 0);
10 putpixel(screen,160,100,30);
11 
12 allegro_exit();
13 return 0;
14 
15}
16END_OF_MAIN();

I do g++ allegroworld.cpp -o allegroworld `allegro-config --libs` and it compile with no error, but when I do ./allegroworld i see an error:

alx@ubuntu:~/Desktop/projects$ ./allegroworld
./allegroworld: symbol lookup error: ./allegroworld: undefined symbol: _install_allegro_version_check

I have search the forums and i have seen in a topic that maybe i have the program compiled with 4.2.1, and run against a 4.2.0 library.

So I do <i>$ ls usr/lib/liballeg* and $ <i>ls usr/local/lib/liballeg*, and this is what I see:

alx@ubuntu:/home/alx/Desktop/projects# ls /usr/lib/liballeg*
/usr/lib/liballeg-4.2.0.so  /usr/lib/liballeg.a  /usr/lib/liballeg.so.4.1  /usr/lib/liballeg.so.4.2
alx@ubuntu:/home/alx/Desktop/projects# ls /usr/local/lib/liballeg*
/usr/local/lib/liballeg-4.2.1.so  /usr/local/lib/liballeg.so.4.2  /usr/local/lib/liballeg_unsharable.a

So i think that the problem is because i have the 4.2.0 and 4.2.1. How can I fix it?

THX I have search but i haven't find any solution. Sorry for my bad english, i'm from europe. ;)

Richard Phipps

Do a make clean or make uninstall in the 4.2.0 directory and then a make install in the 4.2.1 directory?

CGamesPlay

It looks like you installed 4.2.0 from your distro's package manager, so uninstall it through there as well.

Quote:

Sorry for my bad english, i'm from europe. ;)

You crazy Europeans with your colours and labouring and defence and other such malarkey!

habeas corpus

OK guys I have tried to make clean and make uninstall but there aren't any makefile at that path and there are a lots of files in the directory :S

name said:

You crazy Europeans with your colours and labouring and defence and other such malarkey!

Sorry but what's a malarkey?

Thx all.

Richard Phipps

It's an old-fashioned english slang word.

habeas corpus

ok thx, Richard.

And how can I uninstall the allegro 4.2.0? I have already tried make clean and make uninstall but there aren't makefiles...

Richard Phipps

You might need someone who runs a Linux OS, I only use Windows I'm afraid.

CGamesPlay
Quote:

It looks like you installed 4.2.0 from your distro's package manager, so uninstall it through there as well.

habeas corpus

Ok, I have already done it, but there's a new problem, after uninstall i execute the program and i see a new error:

./allegroworld: error while loading shared libraries: liballeg.so.4.2: cannot open shared object file: No such file or directory

So I go to the packet manager in order to install allegro 4.2.1 but I don't see it, there is only the 4.2.0 and 4.1.15 version :/ And I have updated the packet manager but there appears the same versions.

:(

CGamesPlay

Make sure every version of Allegro is uninstalled in your package manager. Then go to the Allegro 4.2.1 directory and make install again (as root of course). Finally, recompile your program.

habeas corpus

Thx, question solved.

Evert
Quote:

Sorry for my bad english, i'm from europe.

So are the English. Granted, their English isn't that good... ;)

Quote:

Finally, recompile your program.

Not nescessary; 4.2.0 and 4.2.1 are backward binary compatible.

CGamesPlay
Quote:

Not nescessary; 4.2.0 and 4.2.1 are backward binary compatible.

Yes, well, I read this error and figured a recompile would fix. Looks like it did ;)

Quote:

./allegroworld: error while loading shared libraries: liballeg.so.4.2: cannot open shared object file: No such file or directory

Evert

It means Allegro is not installed. Installing 4.2.1 would fix it.
Recompiling doesn't hurt anyway. :)

Thread #590109. Printed from Allegro.cc