PDA

View Full Version : DLLs need to have a home in the lib directory


Blaher
12-25-2008, 02:00 PM
I'm currently working on a GTK+ projects with the latest version of Dev-C++.

When I build my project I'm linking to a few DLLs as part of the GTK library and everything builds fine. When I compile it, it says it can't find any of the library DLL files. So I just threw all of them in to the same directory as the .exe is in. I run it and it works fine. However, I'm very tidy and picky, so I want all my DLL files in the lib direcotry. So I need to somehow to get my program to look in the lib directory for the DLLs instead the same one as it's in. Does anyone know how to acheive this?

Spookster
12-25-2008, 10:00 PM
You just have to add the path to their location into your environment path. Typically this is why their is a standard location on Windows for DLL's because that path is defined by default. If you want your DLL's to live in a different location then you would need add that path to your environment path.

Blaher
12-26-2008, 12:29 AM
Alright, I'll have to do that for now.

However I see a lot of applications with DLLs in their bin folder, but there is nothing being set in the PATH environment variable. How are they doing that?

Spookster
12-26-2008, 04:34 PM
They are probably creating a registry key for their application called an app paths key. Just be sure your dll is very uniquely named as windows won't look in that path first so if it finds another dll with the same name in the default search order paths then you will have problems.