<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/129881>129881</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang,windows: why doesn't -fms-runtime-lib=dll implicitly pass -Wl,/NODEFAULTLIB:libcmt?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AlexRouSg
</td>
</tr>
</table>
<pre>
While trying to build a project that uses msvc built glfw which uses the dll runtime,
there are linker errors relating to conflicting runtimes. So the obvious thing to do would be to add `/MD` or the clang eq of `-fms-runtime-lib=dll`.
But apparently that doesn't set `-Wl,/NODEFAULTLIB:libcmt` which was not obvious was the problem as the error only ever say
> LINK : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
So seems rather odd to have to say "use the dll runtime" and "don't use the static runtime" at the same time and wonder if there is a situation where someone would want that or is it something that could be implicitly set?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVF2vozYQ_TXmZZTIGBLggYfcm0VabXor9bbaZ4Mn4NbYqT2E5t9XdtjtVr1Sn9B8zzlzjAxBjxaxZYcXdjhncqHJ-fZk8K9f3PI-Zr1Tj_brpA0C-Ye2I5CDftFGgYSbd7_jQECTJFgCBpjDfUhhgtFcV1gnPUzPEE0IyhjwiyU9IxOvwPiJJvQI0iMYbf9AD-i98wE8GknbuMHZq9FDMrfqsId3l1q6_q7dEttv2crB6hajoMdoSqWAHTkT3U9nduTgfCobjLQj4J_grjG8u85ht_XeGd2z4qyMYUe-Z_zE-OllIZC3m_RoyTyegJXDYJmoCAJSavLVMPHKRPf28_lTd_rt8uvl8wsrTkb3w0xx-JOOVQawjr6vHu2408273uAMm5mYAGfNA_COHoJ8RMZY8Qkun9--ACtOsEpvI-7L25eSN3V0KbzKxZDRPTBRxYN42kdIovrOZIBVU7pLxO_iEcDoPrDiJTk_xOClfzzZeHcQEOcAXqZSp1SkepL3RHlaVIjY6D9HFyCtilHlntx9ywokSQ__SqRnQM4I0ZcqV2cVetBXeCpHB5AQNC2StLOwJmdwMzqLmw5WaTeJOh_zNaWETTDRP3zTi55vRg86njggsaKDTLWFaopGZtjmVZnnNRdNnU1tw8tjfqzzQ38dDhyPVVljXRSiKqtGVcc6063g4sALfsiLPC_qPQ6FGko-9I0SvVI1KznOUpu9Mfd57_yY6RAWbHPR1HWeGdmjCelhCpHkyoSIb9S3sWDXL2NgJTc6UPinBWky2G7pr6u2yq0hKWV6_KDYj_X-I_6bDAH-R9FFly3etBPRLc5gomOiGzVNS78f3MxEF_faPrvtb8FEl3AGJroN6r0VfwcAAP__jUaDQw">