The C++ mangler conflates mangling for unsigned, unsigned long, and unsigned long long depending on the target architecture. Those are separate manglings in C++, independent of their target size. This leads to several linking problems w/ C++ code, in particular when a size_t parameter is involved. We already have some places in cppmangle where we properly handle Id.__c_long/Id.__c_ulong. This should be extended to size_t parameters in extern(C++) functions. We might also consider to change the size_t declaration to exactly match the C++ definition of the used platform.
It's possible to use cpp_ulong which get's the correct mangling, but it's fairly unfriendly to use. https://github.com/dlang/druntime/blob/fb0dafb741d33ae030c2e7a96bee2c61aa4d3cb4/src/core/stdc/config.d#L91
Sometimes I just make the C++ function `extern "C"` and that works.
This has been fixed: https://github.com/dlang/druntime/pull/2160#issuecomment-379976466