Windows: Link with /MT or /MTd

Johan Engelen via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Mon Apr 6 08:38:56 PDT 2015


Hi all,
   Currently, we link both the release and debug versions of 
phobos and druntime with the debug version of MSVC's LIBC 
multithreaded: LIBCMTD.lib.
Actually, while reading CMakeLists.txt, I see that the release 
and debug runtime libs are compiled with the same C-flags and 
LD-flags. Only the D flags are different.
Is this intentional, or would we rather like to link with 
LIBCMT.lib in release mode?

To help the discussion, here some observations (it surprised me):
ldc2 test.d           --> links with phobos2-ldc.lib
ldc2 -d-debug test.d  --> links with phobos2-ldc.lib
ldc2 -g test.d        --> links with phobos2-ldc-debug.lib
So "-g" selects between runtime debug/release runtime versions, 
and "-d-debug" sets the "debug condition" to true (see 
http://dlang.org/version.html)

thanks,
  Johan


More information about the digitalmars-d-ldc mailing list