Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on msvc (error w/ LINK) #15

Open
tbraun96 opened this issue Aug 20, 2020 · 3 comments
Open

Build fails on msvc (error w/ LINK) #15

tbraun96 opened this issue Aug 20, 2020 · 3 comments

Comments

@tbraun96
Copy link

tbraun96 commented Aug 20, 2020

Using rust x86_64-pc-windows-msvc 1.42 nightly

After cloning vanilla zk-paillier, and then trying to run a test in correct_key.rs, I get this error:

error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.114v3gikb4awckxa.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.12yn05zcoymgr6xm.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.1gyten4w8dvon2zp.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.1px2od1nam2mdjff.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.1tojsarasnjwrt29.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.1wg3bamhvejq4ng.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.21cshchx9kjzf9uf.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.220jetlx7obra1qm.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2292n5v63xuzdt6h.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2dcgho96r6cyzdz0.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2i8erytijvhbomq7.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2o0mzrdce8efepvy.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2tlvbfpukzq1ftpg.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2xinwogfwlg76bsx.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.2xzixahpfdcvnuxx.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.30fb7x2o534x641v.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.382d68969wjvpvmt.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.39f5kr7o9ad24k29.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3bv1swjsrxzpimbk.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3eu12950l19x07pc.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3goxvfhmg1gkqqcr.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3ijj6cw19xl50zid.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3kcy1lzaatnmmol3.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3o6dlrz7kz9s69jp.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3rxm6fnwxc00en9g.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.3xhlm88dge046yri.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.403k1o8spcxj8vom.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.40wi14drxlxljcat.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.41jhfhihlc48s4mk.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.42dkyb1n0htl2euz.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.43fixt1bqym6igy9.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.49549a79aztw91vt.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4agigz5r6v1icamz.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4eifyg1ig6einfe3.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4ff9bvbbumirab18.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4krap5s4rtb1z5xn.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4lf0v9wh5gcfium0.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4nyznwbdsqqblvk4.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4qkiilkxxkd6proy.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4v8ioe69nzrrtmks.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.4xkpepdrdtb9hegd.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.50hrkscg3tgt360u.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.58prn9kmiiiwi16h.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.5cw5r9dpzb9fihra.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.5eoz8rfsa0ynh1ve.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.5g7cm4g7k3lixc0v.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.6sakb6zoy05b0yp.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.9jch6zxulz1so4s.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.adexyiz742n3aay.rcgu.o" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.v33fofezt961mjh.rcgu.o" "/OUT:C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.exe" "C:\\hyxe_wave\\target\\debug\\examples\\simple_voting.pcuzk76gfoypp75.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" "/LIBPATH:C:\\hyxe_wave\\target\\debug\\deps" "/LIBPATH:C:\\hyxe_wave\\target\\debug\\build\\ring-be30b89f0b619bcc\\out" "/LIBPATH:C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\hyxe_wave\\target\\debug\\deps\\libserde_json-da937ce24d9dd3d4.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libryu-7d7bfd334e48f5e0.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libitoa-1c78f34c0ced9ebe.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libpaillier-d293a81ff2f074dd.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libgmp-cb817d4fbe422080.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\liblibc-e64a90d38dbfe495.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libtest-443b9fb43a01b194.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libterm-85bf561df9fb28bd.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libgetopts-7981ea95e29bb01d.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunicode_width-cb90f8888e8171f3.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_std-49a10b87ef4d1c53.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libserde-8f9c2e2e9a828b90.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libring-31091ad4255d4a18.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libuntrusted-31b6dc00d1618ef8.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\librayon-555ada12927a3001.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\librayon_core-24191fe220dac309.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libnum_cpus-ab9206cc743f0462.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libcrossbeam_queue-7986cd3c604d95e4.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libcrossbeam_deque-6b3c373a9b29cfc6.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libcrossbeam_epoch-4568d4b3d5168467.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libscopeguard-a129e2008205fd8a.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libmemoffset-84c7ae62eaed872a.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libcrossbeam_utils-6f84d923972d5a07.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\liblazy_static-9e7a4d7abb5a61c1.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libmaybe_uninit-f7b3815591794411.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libcfg_if-64e9234d16957a03.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libeither-967709d550b26e39.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\librand-966f8ef0e17babce.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libwinapi-9171be342221d4d7.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\librand_core-62e3b0263e659697.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\librand_core-9af8045a0bc19588.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libnum_traits-dd0d30d5d579384f.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libnum_traits-819a6cdda0c56747.rlib" "C:\\hyxe_wave\\target\\debug\\deps\\libbit_vec-3f8e51c50471f5dc.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-d2a75bc74b11e2cc.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-915bfcc230c4eda6.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-2d959e942a9e3e5c.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-d889c9534777e0f9.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-c0632338fc51212a.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-c23d6f351d09fb94.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-2098d630f29dcc07.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-68cf5df90ef019f9.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-744c9ad3b176c572.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-f60261e32bf289cf.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-2ef81bd49a7650fd.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-5779894fffb6f902.rlib" "C:\\Users\\tbrau\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-7b6566d5f1691e05.rlib" "gmp.lib" "gmp.lib" "gmp.lib" "gmp.lib" "gmp.lib" "kernel32.lib" "advapi32.lib" "advapi32.lib" "credui.lib" "kernel32.lib" "secur32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'gmp.lib'

I've tried cloning rust-gmp, and then linking the subcrait's rust-gmp dependency towards the cloned/local rust-gmp, but the error persisted. At this point, I'm not sure if the error is on my side, or somewhere else

@omershlo
Copy link
Contributor

Hi @tbraun96 !

  1. you need to install gmp on your machine first : https://gmplib.org
  2. be aware that the code is tested on linux and iOS mainly (for example, both come with gmp installed). It should work well on windows but might require a bit of extra work (as you are now experiencing)

Please let me know if you have further questions

@tbraun96
Copy link
Author

Thanks for the zippy response! Since you don't know if it works on windows, i'll let you know how it goes!

@tbraun96
Copy link
Author

The solution does not appear to be trivial on windows. Compiling GMP on mingw_x64 works, however the output is not gmp.lib, but libgmp.a. Changing the name to gmp.lib and adding that to that path allows cargo to pick it up and read it, but then there are numerous errors relating to not finding the functions. This is non-trivial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants