Jump to content
  • Advertisement
Sign in to follow this  
HolyHillBilly

How do I link my DLLs to Code Blocks?

This topic is 814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just want to build and run some simple allegro code in code blocks, and I've been trying for the last two days to install the allegro library, build/compile it from the zip files, and link it to code blocks.

I finally got to the point where my program will build without error codes, but when I run it I get this:

 

The program can't start because allegro_primitives-5.0.10-md.dll is missing from your computer. Try reinstalling the program to fix this problem.

 

I tried copying the dll file directly into the folder my project is in, but the system just comes up with another missing dll to complain about. Is there anything I can do short of copying hundreds of dll files into my project folder?

Share this post


Link to post
Share on other sites
Advertisement
This doesn't have much to do with Code::Blocks, but with properly installing the Allegro libraries, which unluckily is, indeed a process of "copying around DLLs". Note that copying headers and import libraries to places where Code::Blocks will find them isn't enough (you probably thought that this is it for "installing" the library, but it is only half the story).

There are mainly two places where the DLLs can be copied, the system32 directory, or the directory the program is in. Actually, putting the DLLs into the system directory is the "correct thing" seeing how they are shared libraries, and there is not much sharing if every program has its own libs in its own directory. However, in practice, one usually does exactly the opposite.

Normally, when you build a library and run something like "make install", this should already place the DLLS in the system directory. Which is both good and bad. Good because you can immediately run any program that uses them (so, not much stalling development), but bad because when you deploy your software, you must remember that this has to be done on the end user's computer, too (having libs in the program's dir, you can just zip everything up and be good).

I'm not very familiar with Allegro, only having used it once ages ago... is there not an option to make a monolithic build? That would mean only one DLL needing to be copied around, less trouble.

Share this post


Link to post
Share on other sites

I tried copying the dll file directly into the folder my project is in, but the system just comes up with another missing dll to complain about...


You can use Dependency Walker to find all the DLLs you need, though I suspect you would only need to copy all the allegro DLLs.
 

There are mainly two places where the DLLs can be copied, the system32 directory, or the directory the program is in...

Actually, putting the DLLs into the system directory is the "correct thing"...


I disagree. According to Dynamic-Link Library Search Order for Desktop Applications, it also searches %PATH%, which I argue would be much cleaner than whoring out the system directory to third party libraries. Just add the allegro binary directory to %PATH% and you should be good to go.

I prefer copying (or hard-linking) the DLLs directly into the project directory, that way I can zip-and-deploy at any time. And also avoids the problem (for some libraries):
libwowamazing.dll: x86 or x64? debug or release? Linked against the mutli-threaded runtime or the static runtime? Edited by fastcall22

Share this post


Link to post
Share on other sites

Ok, I get the Dlls figured out (I think). But now I'm getting this error:

 

The procedure entry point_gxx_personality_v0 could not be located in the dynamic link library

C:\GameDev\Projects\Game1\test\bin\Debug\allegrp-5.0.10-md.dll

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!