Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Library Setup for Eclipse

This thread is locked; no one can reply to it. rss feed Print
Library Setup for Eclipse
AceBlkwell
Member #13,038
July 2011
avatar

I haven't programmed in a couple years. Last time I used Allegro 4. Now I'm trying Allegro 5. There are numerous .so files. To just do a hello world type program, which file should I use?
I was trying liballegro.so in hopes it call additional libs as needed. Is this the correct file? It's located under //usr/lib/x86_64-linux-gnu.
On top of that, I can't get Eclipse to recognize it.
Any help would be greatly appreciated.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

The official and repo binaries come as a set of addons. You need to link every one that your program uses.

If you build allegro yourself, you can build a monolithic .so file that includes core allegro and all the addons bundled with it.

AceBlkwell
Member #13,038
July 2011
avatar

Thanks Edgar,

I installed using Ubuntu PPA. I'm guessing that's using binaries given I didn't see it compiling anything.

I thought I seen a listing of the libraries and what they are used for. I can't recall where I found them but I'll run across it somewhere. However, is there a "main" file or are there a different file for each init, keyboard, video, etc.

I'll figure out Eclipse's set up eventually but I need to make sure I'm trying to link an actual library file.

Thanks again and sorry for my limited familiarity.

In reference to another thread on this site, this is why some of us older DOS guys stay with A4 ;D.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

For a simple hello world you'll likely want just allegro, unless it's graphical text in which case you might want font and ttf addons. Then if you want to draw, there's the primitives addon. There is also an audio addon, acodec addon, color addon, image addon, and a few more :

{"name":"613295","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f2122508f3871fb960c688f908e5658c.png","w":987,"h":474,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f2122508f3871fb960c688f908e5658c"}613295

What does eclipse expect for the linker? A file path? Just add the .so files to the link libraries, or add in -lNAME linker options for gcc and set the link directory using -L "/usr/lib/local". Or if you like pain, use pkg-config.

AceBlkwell
Member #13,038
July 2011
avatar

Edgar,

I got it working yesterday. I was entering library name wrong into the linker section of eclipse. Between using/dropping the .so and adding/removing lib along with wrong filename altogether I never hit the right combination. I eventually found the right file and dropped the lib and .so. Worked fine.

In just testing the waters, I included the primitive addon as well and it worked fine. I appreciate the help. Now to tackle event programming. Any suggestions on tutorials?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

DanielH
Member #934
January 2001
avatar

I have a video on YouTube with a basic framework. The source is on Github.

If you want to try it.

While I use MSVS, the code 'should' work with other compilers.

AceBlkwell
Member #13,038
July 2011
avatar

Hey Thx Edgar and DanielH. I appreciate the direction. I'll give these a try. Sorry for the delay in responding. Was sure the thread would have been locked by now ;D.

Go to: