CodeBlocks cannot link allegro library

161 Views Asked by At

I'm a student at an university and currently tasked to do a project of any kind but resticted to using C. I chose to make a video games using allegro5 because it has all the function I need to fulfil my project. I managed to set up the library (I set up build option in the .cbp file) so that it would work for me and currently finishing the program itself. The problem is that, if I send my work to any other person, the allegro library doesn't link up and fails to start up the program. Also, when I try to start .exe file to launch the project on my own device, it also fails to link up. If this makes any sense, I need some advice with linking libraries so that anyone could launch the game from there devices without the need to setup allegro.

Thanks in advance!

1

There are 1 best solutions below

0
On

You need to copy certain .dll files with your exe. If you place the .dll files in the same folder as your .exe, then it should work on other machines.

Which .dll files you ask? Well that depends on the exact variant of allegro that you got. There are variants, such as allegro_monolith-5.2.dll or allegro_monolith-5.2-debug.dll. And these dlls might have dependencies, such as zlib1.dll, libpng16-16.dll and others.

The dependencywalker tool can help you decide which dlls you need.