Manifold Geometry // Многообразная Геометрия


Подписаться на эту рубрику по RSS

How to know if your lib is debug or release on Windows

A little trick for those Windows users who are not happy running the Dependency Walker (depends.exe, download zip) to see if your DLL is debug or release.

Fast non-recursive dep checker.
  1. Open up Visual Studio console.
  2. Head over to the directory with your DLLs/app.
  3. Run dumpbin /dependents <libname>

In the example above, we see that MSVCR100D.dll library is on the list, so it's the debug runtime (because of this "D" letter in the libname). Normally, you would want to avoid debug-vs-release mix in your app, although sometimes those modules are inevitably loaded together. This is what I got for Analysis Situs on my recent discovery:

"Modules" view in Visual Studio 2019.

This picture does not make me happy as I anticipate all sorts of tricky shit popping up in a random manner because of this explosive mix. What dumpbin helps to identify is that release runtime may come from the FreeType library and that sounds Okay (because FreeType is written in pure C language rather than C++, which I would have hated if not liked it a lot). As practice proves, the crashes caused by debug+release mess are often induced by the standard collections (that famous C++-ish STL). Do you also sometimes feel like you'd better wrote everything in C?

Want to discuss this? Jump in to our forum.