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 | |
3 | using namespace std; |
4 | |
5 | int 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 | } |
16 | END_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.
Do a make clean or make uninstall in the 4.2.0 directory and then a make install in the 4.2.1 directory?
It looks like you installed 4.2.0 from your distro's package manager, so uninstall it through there as well.
Sorry for my bad english, i'm from europe.
You crazy Europeans with your colours and labouring and defence and other such malarkey!
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
You crazy Europeans with your colours and labouring and defence and other such malarkey!
Sorry but what's a malarkey?
Thx all.
It's an old-fashioned english slang word.
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...
You might need someone who runs a Linux OS, I only use Windows I'm afraid.
It looks like you installed 4.2.0 from your distro's package manager, so uninstall it through there as well.
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.
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.
Thx, question solved.
Sorry for my bad english, i'm from europe.
So are the English. Granted, their English isn't that good...
Finally, recompile your program.
Not nescessary; 4.2.0 and 4.2.1 are backward binary compatible.
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
./allegroworld: error while loading shared libraries: liballeg.so.4.2: cannot open shared object file: No such file or directory
It means Allegro is not installed. Installing 4.2.1 would fix it.
Recompiling doesn't hurt anyway.