ridiculousfish / libdivide

Official git repository for libdivide: optimized integer division
http://libdivide.com
Other
1.09k stars 77 forks source link

clang-cl: error LNK2019: unresolved external symbol __udivti3 #56

Closed kimwalisch closed 5 years ago

kimwalisch commented 5 years ago

The clang-cl compiler (Windows version of Clang) supports 128-bit integers but not yet 128-bit division. This causes a linker error when compiling libdivide using clang-cl:

> clang-cl /arch:AVX2 /I. /EHsc /W3 /O2 /DLIBDIVIDE_AVX2 test\tester.cpp
tester-d6bae9.obj : error LNK2019: unresolved external symbol __udivti3 referenced in function "private: void __cdecl DivideTest<unsigned __int64>::test_many<0>(unsigned __int64)" (??$test_many@$0A@@?$DivideTest@_K@@AEAAX_K@Z)
tester.exe : fatal error LNK1120: 1 unresolved externals
clang-cl: error: linker command failed with exit code 1120 (use -v to see invocation)
kimwalisch commented 5 years ago

Fixed by https://github.com/ridiculousfish/libdivide/commit/13f56b38131ad04e7552fc45fa5e925fec514fb6

kimwalisch commented 5 years ago

Here is a link to the LLVM bug report: https://bugs.llvm.org/show_bug.cgi?id=25305. The bug has already been reported in 2015 but has not yet been fixed.