GTK+ for Windows: issues with apps locating the dll's



Gnaural writes:
 One glitch, though. I'm finding that my GTK+ apps don't
 automaticaly find the installed GTK+ dll's in Windows. The lazy
 solution was just to set the system PATH variable to point to the
 GTK+ bin directory. But I've been informed that this is bad
 practice, because of (among other things) something called "dll
 hell."

Umm, dunno. I would say that setting PATH to include the "bin" folder
of the GTK+ installation you want to use is quite
straightforward. It's when users start copying DLLs here and there and
then forgetting where they are, and messing with PATH so that they
don't know what copies of the DLLs they really are using that you get
DLL hell.

You could always write a minimal (a dozen of lines) helper exe that
sets the PATH environment variable and then invokes you real
application.

 Does anyone here know why the GTK+ windows apps would give-up
 before even getting to either my main() (or WinMain())?

Well, if the exe requires on DLLs that aren't found, it will never get
to main() (or WinMain()). The DLLs that an exe links to are loaded by
the system before the program starts executing user code.

 And is there another, more straightforward way people are
 accomplishing this (besides either setting the system PATH or
 using some very fudgy-looking platform-dependent registry code to
 find the dll's)?

You could keep your application's exe in the same "bin" folder where
the GTK+ (Pango, atk, GLib etc) DLLs are. Then they will be found
without any PATH manipulation.

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]