Missing builtins MSVC

Danny Arends Danny.Arends at gmail.com
Sat Sep 5 14:20:08 UTC 2026


Hey All,

Was trying to use importC with the latest MSVC runtime (Visual 
Studio/Build tools 2026), and got the following linker issues 
(all related to ucrt\wchar.h and ucrt\string.h). Missing from 
`Windows Kits\10\Include\10.0.26100.0`:

Error: undefined reference to `_mm_cvtsi32_si128` referenced from 
`wmemchr`
Error: undefined reference to `_mm256_broadcastw_epi16` 
referenced from `wmemchr`
Error: undefined reference to `_mm256_loadu_si256` referenced 
from `wmemchr`
Error: undefined reference to `_mm256_cmpeq_epi16` referenced 
from `wmemchr`
Error: undefined reference to `_mm256_movemask_epi8` referenced 
from `wmemchr`
Error: undefined reference to `_BitScanForward` referenced from 
`wmemchr`
Error: undefined reference to `_mm_set1_epi16` referenced from 
`wmemchr`
Error: undefined reference to `_mm_loadu_si128` referenced from 
`wmemchr`
Error: undefined reference to `_mm_cmpeq_epi16` referenced from 
`wmemchr`
Error: undefined reference to `_mm_movemask_epi8` referenced from 
`wmemchr`
Error: undefined reference to `_mm_loadl_epi64` referenced from 
`wmemchr`
Error: undefined reference to `_BitScanForward64` referenced from 
`wmemcmp`

I can see from DRuntime that `_BitScanForward` and 
`_BitScanForward64` forward were already added since DMD v2.113.0 
was released.

Also, MSVC toolset 2026 defines `__check_arch_support`, whose 
body references the compiler-emitted constants `__arch_avx10ver` 
and `__arch_inverted`. MSVC codegen stamps these per object from 
its flags, but ImportC does not emit them, so they are unresolved 
even on an older SDK.


Will the _mm* functions be added to __builtins_msvc.d at some 
point ?


More information about the Digitalmars-d-learn mailing list