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

Linking fails on Windows if other -sys crates link to the system zlib #56

Open
999eagle opened this issue Sep 24, 2019 · 0 comments
Open

Comments

@999eagle
Copy link

999eagle commented Sep 24, 2019

I'm trying to compile something for Windows (using msvc), but I have a static link version of zlib on my include and lib paths. Other -sys crates link to the system installed zlib, but as libz-sys builds zlib again this leads to the following error:

  = note: liblibz_sys-aa3193a377538516.rlib(inflate.o) : error LNK2005: inflateCodesUsed already defined in libmozjs_sys-a5f33b0cb310126e.rlib(inflate.obj)
          liblibz_sys-aa3193a377538516.rlib(inflate.o) : error LNK2005: inflateValidate already defined in libmozjs_sys-a5f33b0cb310126e.rlib(inflate.obj)
          liblibz_sys-aa3193a377538516.rlib(deflate.o) : error LNK2005: deflateGetDictionary already defined in libmozjs_sys-a5f33b0cb310126e.rlib(deflate.obj)
          liblibz_sys-aa3193a377538516.rlib(adler32.o) : error LNK2005: adler32_z already defined in libmozjs_sys-a5f33b0cb310126e.rlib(adler32.obj)
          liblibz_sys-aa3193a377538516.rlib(crc32.o) : error LNK2005: crc32_z already defined in libmozjs_sys-a5f33b0cb310126e.rlib(crc32.obj)

Is it possible for libz-sys to use the system zlib if it's available? I think the call to zlib_installed should be just made on msvc as well and that's it, but I'm not sure if that's all there is to it.

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

1 participant