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



First of all, big thanks to Tor Lillqvist and everyone else involved in the GTK+ for Windows port. Because of 
the GTK+, Glib, the MinGW cross-compiler, and WINE, I never have to leave Linux (or even own a Windows box) 
to make some Windows users happy! I love that -- in fact, it is the main feature that's made me commit to 
GTK+.
 
 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." 
The suggestion was to find the dll's using the registry.
 
 So looking at Gaim's code, I found win_game.c, and a "dll_prep()" function that was transplantable. Sure 
enough, it compiled in my code just fine. But, to my surprise, it turns out that the "I can't find the dll's" 
errors seem to kill my app even before any part of my own code has actually been executed! IOW, execution 
doesn't even get to my main() before something in the executable's initialization process gives-up on account 
of not findig the GTK+ dlls. Reading some of the messages around here got me to explore using WinMain() 
instead of main(), but I didn't see any change.
 
 Does anyone here know why the GTK+ windows apps would give-up before even getting to either my main() (or 
WinMain())? 
 
 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)?
 
 Small picture, I just want to solve this little problem so not too many more of the Windows downloaders 
don't conclude my app doesn't work.
 
 Big-picture, I keep thinking that somehow finding the DLL's should be an innate part of the actual Win32 
GTK+ port, both for inter-platform transparency and to keep non-Windows programmers from writing poorly 
written/understood Win32 code. After all, apps like mine (that is, Linux apps that rely on the amazing Win32 
GTK+ port to become Windows apps) don't actually function without this little matter being taken care of 
somehow -- so it is tied to basic functionality.
 
 I mean, as it is, about the only actual Windows code I feel I need to write is if I feel giving my users a 
pretty desktop icon! Which is an awesome state of affairs. But what is not so awesome is that so long as 
finding dll's is a complicated, windows-knowledgable task, the tendency will for Linux developers in a hurry 
to dump-out a Windows executable will surely just to be to add to the "dll-hell" problem with system PATH 
addendums.
 
 
 Technical background (just in case that's my problem): I've been using the 2.6.9 GTK+ for Windows installer 
offered with GIMP, and have also tried the 2.6.9 rev. a that Gaim currently passes-out. [Unrelated Note: only 
the 2.6.9 rev. a package works in WINE -- all the apps are black for me when using the one offered with GIMP].
 
 Also, I am cross-compiling with the standard Debian MinGW32 package, with -mwindows to get rid of the 
console window (I mention in case it is related to why WinMain() acted the same as main())
 



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