3

I got the Allegro dev libraries, wrote and compiled a simple application, and ran it on my computer, and it worked fine. I had a friend test it, but it did not do anything when double clicked. I think the problem is that he does not have the Allegro library installed, so the program doesn't work. Is the only way to make it work for him to manually install the library and dependencies, or is there some way to package the necessary libraries with the application?

EDIT: Sorry, I meant to say I was using Allegro 5.

Matthew
  • 47,584
  • 11
  • 86
  • 98
awesomeguy
  • 290
  • 3
  • 10

1 Answers1

1

I assume you are using Allegro 4 since you are working with Ubuntu packages. If so, you can link against the static liballeg.a library. However, there are still additional dependencies.

Running ldd on your executable will show which dependencies are required. If your friend runs ldd, it will tell him which dependencies are missing.

Edit: Since you are using Allegro 5, you would need to compile the static version. From a fresh build directory:

cmake -DSHARED=off ..
make
sudo make install

Then when building:

gcc game.c -o game $(pkg-config --libs --static allegro-static-5.0)

And again, there will be other dependencies, but your friend could just install them with apt-get.

Matthew
  • 47,584
  • 11
  • 86
  • 98