Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Installing allegro 5.2

This thread is locked; no one can reply to it. rss feed Print
Installing allegro 5.2
Scooter
Member #16,799
January 2018

Hi all:
I have installed a new version on Linux and I want to compile my programs
on this version. It uses the RPM packages. I downloaded the allegro package
and extracted into a directory. I am confused about which option I should use
to build the libraries.
I would also like to install opengl 2.0. If someone could post the steps to
do this I would be thankful. Thanks for your time.

Niunio
Member #1,975
March 2002
avatar

I recommend you to look for Allegro at your repository and use RPM tools to install it. It is much more easy and you won't deal with dependencies.

-----------------
Current projects: Allegro.pas | MinGRo

Scooter
Member #16,799
January 2018

Niunio:
Thanks for your reply. I have already check them out. Neither are found in the
Repository supplied with Mageia. Also I have run into a serious problem with
Codeblocks. I compiled a simple hello.c program and it worked fine in codeblocks
but I could not run the executable written to the directory. This has happened on
every 64 bit version of Linux I have tried. I put the question on the codeblocks
forum, but nobody could solve it.
I did find some info on building allegro 5.2. I tried to build the static libraries
but it generated many errors. Never had this problem on a 32 bit version. Don't
know what to do next. Hope all is well.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

There's nothing wrong with CodeBlocks. It's probably not finding runtime libraries when you run it separately. Check the current working directory and the LD_LIBRARY_PATH.

As for static linking on Linux don't bother, it's a pain in the ass and it never works right.

Scooter
Member #16,799
January 2018

Edgar:
I finally got the shared libraries for allegro loaded.
LD_LIBRARY_PATH set to /usr/lib64
ran ldconfig
loaded code::blocks
tried to compile a simple file
code::blocks says allegro file /usr/lib64/liballegro_so.5.2.3 not there
In Search Directories I also put /usr/lib64

What else must I do? Thanks for any help.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Because it is linking to a version you haven't installed? Is the file there?

To install OpenGL, you need to install the mesa-dev packages for your distro.

Can you share your .cbp file? I can't tell what is wrong without it.

If you're using the global compiler for CB, don't it will only mess up future projects. Make sure you're using a dedicated project to build your program with.

Scooter
Member #16,799
January 2018

Edgar:
OK, I found the error. It must have found the library.
More errors came up but I got them solved.
Now this error showed up:
/home/iurt/rpmbuild/BUILD/glibc-2.29/csu/../sysdeps/x86_64/start.s
undefined reference to main

Incidently, I only compile single files. Do I have to have a project file?
Never had any luck using one.

edit:
I don't think I will live long enough to get allegro and opengl to work
on this new system. I think I will go back to my Ubuntu 14.04 machine.
Everything just works on it. I love this new system but it is driving me
crazy trying to figure it out. Just one error after another!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Scooter
Member #16,799
January 2018

Edgar:
I agree, it is an old system. I have everything working perfectly on it.
I believe my problem is the 64 bit. I have tried two different versions and
codeblocks will not work right on either one. I seem to do better with the 32 bit versions. Mageia has one. I may give it a try later on. I hate to give up but I
guess I don't have the knowledge to correct all the problems with the 64 bit versions. I know everything is going 64 bit but I can't handle it. I already have many hours trying to get this 64 bit version working . Its time to let it go.
I am a little upset having to give up but I will get over it.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Scooter
Member #16,799
January 2018

Edgar:
OK! I have it figured out. It will run from the command line,
but not from the directory. Codeblocks needs to be configured.
Can you help me please! Here is what the icon looks like in the
directory: Click above png file.

I have no idea what needs to change in codeblocks.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

First, tell me what Linux you are running, with version. And what version of CB you are running. First try to make a project. You can follow my directions here , but adapt them for Linux :

https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5

The libraries will be different, but the steps are the same.

Set the search directories for the compiler and linker.

Set the libraries to link.

Set the runtime directory.

Build and run the project. If this fails, post your .cbp project and I'll see if I can fix it.

Scooter
Member #16,799
January 2018

Edgar:
I followed your instructions for installing on Ubuntu.
Everything seemed fine except I had no Icon so I could not
load codeblocks. I finally got it loaded with the command line.
Everything works using the command line but the Icon in the
directory will not open the executable file by double clicking.
Tried to start a project but codeblocks says it can't create
the project directory.
What a thrill ride!

I am using Lubuntu 18.04, codeblocks 16.01

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Scooter
Member #16,799
January 2018

Edgar:
I have deleted and installed codeblocks many times.
Still get the same thing. That's the reason I always
go back to Ubuntu 14.04. Everything works GREAT!
Might be because it is 32 bit. This 64 bit SUCKS!

Go to: