clang-cl error: lld-link : error : undefined symbol: __divti3

3.2k views Asked by At

When compile int128 division method with clang-cl (Clang-11.0 and MSVC2019), it occurs this error.
Code like:

__int128 a, b;
auto c = a / b;

and compiler outputs:

1>lld-link :error : undefined symbol: __divti3
1>>>> referenced by <path>\int128.h:594

How to fix it ?

1

There are 1 answers

2
273K On

You have to link your executable with clang_rt.builtins-x86_64.lib.
You can find it in

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\<Version>\lib\x64