Archived

This topic is now archived and is closed to further replies.

martinboehme

Debugging "unable to load gauge" errors

Recommended Posts

Hi everyone,on a C++ gauge that I'm developing for FS9, I'm getting the dreaded error message "Flight Simulator was unable to load some aircraft or software", which usually means that FS can't find a required DLL.I've checked everything, but I just can't work out what DLL I'm missing -- all of the ones I think I need are either on the search path or right in the FS9 directory.Does anyone know of a way that I can get FS to actually _tell_ me which DLL it can't find?Cheers,Martin

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You really need to load your gauge file into "Dependency Walker."http://www.dependencywalker.com/Note, "Dependency Walker" is part of several Microsoft products, such as Visual Studio, Visual C++, Visual Basic, Windows 2000/XP/2003 support tools (on the Windows CD), Windows 98/NT/2000/XP/2003 Resource Kits, Platform SDK, Windows DDK, Windows SDK, and MSDN.The link posted above is to allow folks to keep up-to-date more easily.You can use this program to let you know what .dll or .lib you forgot to include in your gauge build... ;)"Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures."

Share this post


Link to post
Share on other sites

Hi Bill,thanks for the tip -- I had already used Dependency Walker on the gauge, but unfortunately, to no avail... I've used it to debug this kind of problem in the past, but it's not showing anything unusual this time round.I _am_ getting one warning:"Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module."I think this is normal, though -- I remember that I was getting it back when the gauge was functioning normally. I think this message refers to the two files SHLWAPI.DLL (which is being displayed with a red "window" icon) and IEFRAME.DLL (which is being displayed with a red "window" icon along with an hourglass icon, which I'm guessing signifies that it's a delay-load module).Notwithstanding the fact that I was getting this before when the gauge was still working, could this have anything to do with my problem? My interpretation of this warning was that Microsoft is just doing something strange in its own DLLs (I think these are both MS DLLs, right?), but maybe I'm wrong... and I have to admit I'm not totally clear on what that error message is trying to tell me...As another point of note, I've written a short program that just does a LoadLibrary() call on the gauge, and that works fine... which would seem to indicate that maybe the problem isn't a missing DLL after all. Any ideas on what could cause FS to report "unable to load gauge" apart from a missing DLL?Cheers,Martin

Share this post


Link to post
Share on other sites

After some more experimentation, I seem to have solved the problem. I'm still not quite sure what was going wrong, though...What got me on the right track was that I went back to a previous compiled version of that gauge that I knew worked -- and it gave me the same error message. That indicated that it wasn't the gauge itself but something about the environment that had changed.I had previously put all of the DLLs that the gauge depended on into the main FS9 directory, and that worked. What I tried now was copying those DLLs into the Gauges directory -- and lo and behold, that made the problem go away.I'm still not sure what caused this change -- I remember that when I initially tried putting my DLLs in the Gauges directory, that didn't work. Is there a "right" way to do this?Cheers,martin

Share this post


Link to post
Share on other sites