What is proper naming convention for MSVC dlls, static libraries and import libraries

cmake, dll, naming-conventions, static-libraries, visual-c++

Solution

You distinguish between a library and a .dll by the extension. But you distinguish between a import library and a static library by the filename, not the extension.

There will be no case where an import library exists for a set of code that was built to be a static library, or where a static library exists for a dll. These are two different things.

There is no single MSVC standard filename convention. As a rule, a library name that ends in "D" is often a debug build of library code, `msvcrtd.dll` vs `msvcrt.dll` but other than that, there are no standards.

Problem

What is standard or "most-popular" naming convention for MSVC library builds. For example, for following platforms library `foo` has these conventions: Linux/gcc: ``` shared: libfoo.so import: --- static: libfoo.a ``` Cygwin/gcc: ``` shared: cygfoo.dll import: libfoo.dll.a static: libfoo.a ``` Windows/MinGW: ``` shared: libfoo.dll import: libfoo.dll.a static: libfoo.a ``` What should be used for MSVC buidls? As far as I know, usually names are `foo.dll` and `foo.lib`, but how do you usually distinguish between import library and static one? Note: I ask because `CMake` creates quite unpleasant collision between them naming both import and static library as `foo.lib`. See bug report. The answer would help me to convince the developers to fix this bug.

Original source