Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Newbie help - program can't run correctly

Credits go to CGamesPlay for helping out!
This thread is locked; no one can reply to it. rss feed Print
Newbie help - program can't run correctly
habeas corpus
Member #8,329
February 2007
avatar

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
Member #1,632
November 2001
avatar

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
Member #2,559
July 2002
avatar

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!

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

habeas corpus
Member #8,329
February 2007
avatar

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
Member #1,632
November 2001
avatar

It's an old-fashioned english slang word.

habeas corpus
Member #8,329
February 2007
avatar

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
Member #1,632
November 2001
avatar

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

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

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

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

habeas corpus
Member #8,329
February 2007
avatar

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
Member #2,559
July 2002
avatar

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.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

habeas corpus
Member #8,329
February 2007
avatar

Thx, question solved.

Evert
Member #794
November 2000
avatar

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
Member #2,559
July 2002
avatar

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

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Evert
Member #794
November 2000
avatar

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

Go to: