Search code examples
visual-studiodlllinkerproject-settings

How to tell linker that I want my dll build in debug mode to have d suffix


I'm building a library in debug mode and it builds fine, but the built version of this library doesn't indicate in any way that it is built in debug mode. What I mean is that if the library is called mylib and after building it in debug mode I'm getting mylib.dll I don't really know in what mode did I built it. I'd prefer that I would have my output called mylibd.dll or mylib_d_.dll, but is this possible to specify something like it in Visual Studio 2015?


Solution

  • In Visual Studio you can have settings that differ per build configuration. Therefore, to achieve what you want, you would change the library names only for the Debug configuration.

    In Solution Explorer, right click on the library in question, and go to Properties. Make sure the Configuration combo is set to Debug. Then, in Configuration Properties select the General group and change the Target Name setting as you like.

    There are also several individual settings for the output files generated:

    • Linker/General/Output File
    • Linker/Manifest File/Manifest File
    • Linker/Debugging/Generate Program Database File
    • Linker/Advanced/Import Library

    You can double check the full command line in Linker/Command Line to make sure all the filenames match your expectations.

    Similarly, this can be done for static libraries as well. The appropriate configuration properties group in this case is called Librarian.