Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Ubuntu 9.10 Allegro 4.4.0

This thread is locked; no one can reply to it. rss feed Print
Ubuntu 9.10 Allegro 4.4.0
hagen2
Member #11,570
December 2009

Hello, this is my first post.

I'm using Ubuntu 9.10 and the default repository uses Allegro 4.2. I downloaded the source to 4.4.0 as I would like AllegroGL and the other extensions it has built-in. I then ran cmake, make and 'make install' and all seemed to go well.

allegro-config --libs --version
4.4.0
-L/usr/local/lib -lalleg

When I try to compile+link (even the simplest of programs that I had no problem with using 4.2) I now get the following error message :

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

Any pointers would be appreciated.

SiegeLord
Member #7,827
October 2006
avatar

Have you done

sudo ldconfig

?

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

hagen2
Member #11,570
December 2009

No I hadn't. Thank you. I am learning what it means to develop on Linux and appreciate your help and quick response. It seems to be working fine now. :D

Here are the steps I took :

1) Uninstalled 'liballegro4.2-dev' in Synaptic. Not a required step if you haven't already installed it from the default repository.

2) Downloaded source from Allegro site (allegro-4.4.0.tar.gz), extracted it and navigated to it's directory via the command line.

3) Installed cmake : sudo apt-get install cmake

4) Installed dependencies (hinted at in docs/build/cmake.txt) : sudo apt-get install libogg-dev libvorbis-dev libpng12-dev libasound2-dev libjack-dev libbio2jack0 libbio2jack0-dev

5) cmake CMakeLists.txt

6) make

7) sudo make install

8) sudo ldconfig

Have I missed anything? I am hoping it may be of assistance to others just starting out. I would appreciate a more experienced user's verification of the above.

Thanks again SiegeLord.

Peter Wang
Member #23
April 2000

1. Most users don't need JACK, but it doesn't hurt.

2. The flag should be -DWANT_LINUX_CONSOLE. I think most users won't have any use for it nowadays.

3. You don't need to be root for the "make" step, just make install and ldconfig.

hagen2
Member #11,570
December 2009

Thank you Peter. I have edited the steps above, is that better?

Are the addons for Allegro-4.4.0 automatically installed through the above procedure? I am getting errors (missing files) when I attempt to compile the "very special hello world" found here : http://wiki.allegro.cc/index.php?title=Hardware_Accelerated_Allegro_%28AllegroGL%29

gcc -Wall -c "test.c"
In file included from /usr/local/include/alleggl.h:73, from test.c:2:
/usr/local/include/allegrogl/gl_ext.h:12:41: error: allegrogl/GLext/gl_ext_defs.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:16:42: error: allegrogl/GLext/glx_ext_defs.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:27:41: error: allegrogl/GLext/gl_ext_api.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:31:42: error: allegrogl/GLext/glx_ext_api.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:43:44: error: allegrogl/GLext/gl_ext_alias.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:53:45: error: allegrogl/GLext/glx_ext_alias.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:61:45: error: allegrogl/GLext/gl_ext_list.h: No such file or directory
/usr/local/include/allegrogl/gl_ext.h:68:46: error: allegrogl/GLext/glx_ext_list.h: No such file or directory
Compilation failed.

Peter Wang
Member #23
April 2000

Looks like you are missing OpenGL development files. The addons will be built if the required dependencies can be found by CMake. e.g. on my machine:

-- Looking for glXGetProcAddress
-- Looking for glXGetProcAddress - found
-- Found ZLIB: /usr/lib64/libz.so
-- Found PNG: /usr/lib64/libpng.so
-- Found VORBIS: /usr/include

hagen2
Member #11,570
December 2009

I did have the following reported when I ran CMake :

-- Looking for glXGetProcAddress
-- Looking for glXGetProcAddress - found

Peter, I also found that if I didn't 'sudo make' I was getting a permission denied error.

I was using Allegro 4.2 happily. I wanted to give hardware accelerated 2D a try because I want a fluid 1920x1200 full screen experience. I figured rather than installing Allegrogl separately I may as well get 4.4.0 which has that and more. I have installed numerous mesa-dev, nvidia-glx-dev and other libraries to no avail. If someone started with a fresh Ubuntu 9.10 installation and wanted to be Allegro 4.4.0 ready ... what exactly needs to happen? I have no problem using 4.4.0 itself, but no luck with the Allegrogl addon in particular.

Here is the code I am unable to compile :

#include <allegro.h>
#include <alleggl.h>
 
int main() {
   if (allegro_init() != 0) {
      return 1;
   }
   if (install_allegro_gl() != 0) {
      return 1;
   }
 
   install_keyboard();
   install_timer();
 
   allegro_gl_set(AGL_DOUBLEBUFFER, 1);
   allegro_gl_set(AGL_WINDOWED, TRUE);
   allegro_gl_set(AGL_COLOR_DEPTH, 32);
   allegro_gl_set(AGL_SUGGEST, AGL_DOUBLEBUFFER | AGL_WINDOWED | AGL_COLOR_DEPTH);
   if(set_gfx_mode(GFX_OPENGL, 800, 600, 0, 0)) {
       allegro_message ("Error setting OpenGL graphics mode:\n%s\n"
                        "Allegro GL error : %s\n",
                        allegro_error, allegro_gl_error);
       exit(0);
   }
 
   allegro_gl_set_allegro_mode();
 
   textout_ex(screen, font, "Hello World!", 50, 100, makecol(255, 0, 0), -1);
 
   allegro_gl_unset_allegro_mode();
 
   allegro_gl_flip();
   readkey();
 
   return 0;
}
END_OF_MAIN()

Peter Wang
Member #23
April 2000

Have a look in your CMakeCache.txt and CMakeFiles/CMakeError.log files. If you can't figure it out you can attach it here.

You don't need root permissions to make. You probably extracted the package earlier as root so don't have write permission.

hagen2
Member #11,570
December 2009

Thanks Peter.

I have attached the two files you referred me to. Can you shed any light on my situation?

Should I be uninstalling Allegro 4.4.0 before re-installing it? If so, how do I perform a proper uninstall?

Among several other dependencies I have installed both libglu1-mesa-dev and libgl1-mesa-dev.

Peter Wang
Member #23
April 2000

Oops, sorry. Some of the AllegroGL header files aren't being installed. I will put up Allegro 4.4.0.1 today.

hagen2
Member #11,570
December 2009

Oops, sorry. Some of the AllegroGL header files aren't being installed. I will put up Allegro 4.4.0.1 today.

Great news! Thank you very much Peter. 8-)

I can now compile. However, I can't link properly.

gcc -W -Wall -s -O2 -pipe demo.c -o demo -lagl `allegro-config --libs` -lGL -lGLU
/usr/bin/ld: cannot find -lagl
collect2: ld returned 1 exit status

Peter Wang
Member #23
April 2000

It should be -lalleggl now (the file is called liballeggl.a).

hagen2
Member #11,570
December 2009

Working for me now! Thanks again Peter for all your help.

Go to: