ShiftMediaProject / gmp

Unofficial GMP with added custom native Visual Studio project build tools. GMP: GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.
https://gmplib.org/
GNU Lesser General Public License v3.0
83 stars 42 forks source link

In windows x64 build #5

Closed shangsony closed 5 years ago

shangsony commented 5 years ago

Context

Expected Behavior

Actual Behavior

Steps to Reproduce

1>alt_bn128_g1.obj : error LNK2019: unresolved external symbol _gmp_printf referenced in function "public: void thiscall libsnark::alt_bn128_G1::print(void)const " (?print@alt_bn128_G1@libsnark@@QBEXXZ) 1>alt_bn128_g2.obj : error LNK2001: unresolved external symbol _gmp_printf 1>libzsl.obj : error LNK2001: unresolved external symbol ___gmpn_add_n 1>alt_bn128g1.obj : error LNK2001: unresolved external symbol gmpn_add_n 1>alt_bn128_g2.obj : error LNK2001: unresolved external symbol _gmpn_add_n 1>alt_bn128init.obj : error LNK2001: unresolved external symbol gmpn_add_n 1>alt_bn128_pairing.obj : error LNK2001: unresolved external symbol _gmpn_addn 1>libzsl.obj : error LNK2001: unresolved external symbol gmpn_addmul_1 1>alt_bn128_g1.obj : error LNK2001: unresolved external symbol _gmpn_addmul_1 1>alt_bn128g2.obj : error LNK2001: unresolved external symbol gmpn_addmul_1 1>alt_bn128_init.obj : error LNK2001: unresolved external symbol _gmpn_addmul_1 1>alt_bn128pairing.obj : error LNK2001: unresolved external symbol gmpn_addmul_1 1>libzsl.obj : error LNK2001: unresolved external symbol _gmpn_gcdext 1>alt_bn128_g1.obj : error LNK2001: unresolved external symbol _gmpn_gcdext 1>alt_bn128g2.obj : error LNK2001: unresolved external symbol gmpn_gcdext 1>alt_bn128_init.obj : error LNK2001: unresolved external symbol _gmpn_gcdext 1>alt_bn128pairing.obj : error LNK2001: unresolved external symbol gmpn_gcdext 1>libzsl.obj : error LNK2001: unresolved external symbol ___gmpn_mul_n 1>alt_bn128g1.obj : error LNK2001: unresolved external symbol gmpn_mul_n 1>alt_bn128_g2.obj : error LNK2001: unresolved external symbol _gmpn_mul_n 1>alt_bn128init.obj : error LNK2001: unresolved external symbol gmpn_mul_n 1>alt_bn128_pairing.obj : error LNK2001: unresolved external symbol _gmpn_muln 1>libzsl.obj : error LNK2001: unresolved external symbol gmpn_sub_n 1>alt_bn128_g1.obj : error LNK2001: unresolved external symbol _gmpn_sub_n 1>alt_bn128g2.obj : error LNK2001: unresolved external symbol gmpn_sub_n 1>alt_bn128_init.obj : error LNK2001: unresolved external symbol _gmpn_sub_n 1>alt_bn128pairing.obj : error LNK2001: unresolved external symbol gmpn_sub_n 1>libzsl.obj : error LNK2001: unresolved external symbol _gmpn_tdiv_qr 1>alt_bn128g1.obj : error LNK2001: unresolved external symbol gmpn_tdiv_qr 1>alt_bn128_g2.obj : error LNK2001: unresolved external symbol _gmpn_tdiv_qr 1>alt_bn128init.obj : error LNK2001: unresolved external symbol gmpn_tdiv_qr 1>alt_bn128_pairing.obj : error LNK2001: unresolved external symbol _gmpn_tdivqr 1>libzsl.obj : error LNK2001: unresolved external symbol gmpn_copyi 1>alt_bn128_g1.obj : error LNK2001: unresolved external symbol _gmpn_copyi 1>alt_bn128_g2.obj : error LNK2001: unresolved external symbol _gmpn_copyi 1>alt_bn128init.obj : error LNK2001: unresolved external symbol gmpn_copyi 1>alt_bn128_pairing.obj : error LNK2001: unresolved external symbol _gmpncopyi 1>libzsl.obj : error LNK2001: unresolved external symbol gmpn_zero 1>alt_bn128_g1.obj : error LNK2001: unresolved external symbol _gmpn_zero 1>alt_bn128g2.obj : error LNK2001: unresolved external symbol gmpn_zero 1>alt_bn128_init.obj : error LNK2001: unresolved external symbol _gmpn_zero 1>alt_bn128pairing.obj : error LNK2001: unresolved external symbol gmpn_zero 1>alt_bn128_init.obj : error LNK2019: unresolved external symbol _gmpn_set_str referenced in function "public: thiscall libsnark::bigint<4>::bigint<4>(char const *)" (??0?$bigint@$03@libsnark@@QAE@PBD@Z) 1>alt_bn128pairing.obj : error LNK2001: unresolved external symbol gmpn_set_str 1>libzsl.obj : error LNK2019: unresolved external symbol _gmpn_rshift referenced in function "class std::vector<int64,class std::allocator<__int64> > __cdecl libsnark::find_wnaf<4>(unsigned __int64,class libsnark::bigint<4> const &)" (??$find_wnaf@$03@libsnark@@YA?AV?$vector@_JV?$allocator@_J@std@@@std@@_KABV?$bigint@$03@0@@Z) 1>....\build\win32\dbin\gmp.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86' 1>E:\work\bubi\project\test_atl_bn128\zsl\build\win32\dbin\LibZsl.exe : fatal error LNK1120: 11 unresolved externals 1>Done building project "LibZsl.vcxproj" -- FAILED.

Your Environment

Possible Fix

Sibras commented 5 years ago

You are building a 64bit application but trying to link to a 32bit library. This obviously doesnt work. Link to the correct library to fix it.

shangsony commented 5 years ago

I link to a 64bit gmp.lib library.

Sibras commented 5 years ago

Well your clearly mixing 32bit and 64bit as per this error.

1>....\build\win32\dbin\gmp.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'