WIN64: 'one or more multiply defined symbols found' errors for shared GMP builds using Windows ICC and MSVC
sav_ix at ukr.net
sav_ix at ukr.net
Sat Jan 27 17:56:57 UTC 2018
For GMP builds using Windows ICC and MSVC got errors:
get_ui.obj : error LNK2005: __gmpz_get_ui already defined in bin_ui.obj
neg.obj : error LNK2005: __gmpz_neg already defined in bin_ui.obj
add.obj : error LNK2005: __gmpn_add already defined in add.obj
add_1.obj : error LNK2005: __gmpn_add_1 already defined in add_ui.obj
sub.obj : error LNK2005: __gmpn_sub already defined in sub.obj
sub_1.obj : error LNK2005: __gmpn_sub_1 already defined in sub.obj
neg.obj : error LNK2005: __gmpn_neg already defined in sub.obj
cmp.obj : error LNK2005: __gmpn_cmp already defined in cmp.obj
zero_p.obj : error LNK2005: __gmpn_zero_p already defined in combit.obj
Creating library .libs/gmp.lib and object .libs/gmp.exp
.libs\gmp-10.dll : fatal error LNK1169: one or more multiply defined symbols found
(log added in attachment).
- shared GMP builds using Windows ICC and MSVC,
not reproduced for:
- static GMP builds using Windows ICC and MSVC,
- shared GMP builds using mingw-w64,
- shared MPFR and libiconv builds using Windows ICC and MSVC.
- Windows 10 x64,
- ICC 2018 Update 1,
- MSVC 2017 15.5.0,
- Windows SDK 10.0.16299.15,
- mingw-w64 x86_64 posix seh 7.2.0,
- MSYS2 x86_64 20170918,
The workaround is to use '-FORCE:MULTIPLE' flag, which results to warning:
.libs\gmp-10.dll : warning LNK4088: image being generated due to /FORCE option; image may not run
Even it has no visible effect on 'make check' run, compared to static builds or builds using mingw-w64, would be nice to get rid of it.
Since Windows ICC and MSVC are not officially supported by GMP, it's hard to expect, that this issue would be fixed for them.
But for a few past years a number of such errors decreased from about a hundred to nine, which could be a result of refactoring in GMP code. If such a refactoring took place, and this errors points to its flaws, would be nice to finish it completely.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 47133 bytes
Desc: not available
More information about the gmp-bugs