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

Fails to build on Windows with Clang #109

Closed
aminya opened this issue Dec 24, 2021 · 5 comments
Closed

Fails to build on Windows with Clang #109

aminya opened this issue Dec 24, 2021 · 5 comments

Comments

@aminya
Copy link

aminya commented Dec 24, 2021

Trying to install cargo-udeps on Windows fails with these linker errors:


   liblibgit2_sys-ba969b860dee402e.rlib(refdb_fs.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(midx.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(sortedcache.o) : error LNK2001: unresolved external symbol close
          libcurl_sys-0d9aaa1630205f23.rlib(file.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(pack.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(mwindow.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(diff_file.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(hashsig.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(filter.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(odb_loose.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(commit_graph.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(indexer.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(path.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(attr_file.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(posix_w32.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(filebuf.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(blob.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(diff_generate.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(index.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(futils.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(repository.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(odb.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(checkout.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(worktree.o) : error LNK2001: unresolved external symbol close
          liblibgit2_sys-ba969b860dee402e.rlib(futils.o) : error LNK2019: unresolved external symbol umask referenced in function git_futils_mktmp
          liblibgit2_sys-ba969b860dee402e.rlib(posix.o) : error LNK2019: unresolved external symbol read referenced in function p_read
          libcurl_sys-0d9aaa1630205f23.rlib(warnless.o) : error LNK2001: unresolved external symbol read
          liblibgit2_sys-ba969b860dee402e.rlib(posix.o) : error LNK2019: unresolved external symbol write referenced in function p_write
          libcurl_sys-0d9aaa1630205f23.rlib(warnless.o) : error LNK2001: unresolved external symbol write
          libcurl_sys-0d9aaa1630205f23.rlib(vauth.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(rename.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(digest_sspi.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(socks_sspi.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(schannel_verify.o) : error LNK2001: unresolved external symbol strdup
          liblibgit2_sys-ba969b860dee402e.rlib(stdalloc.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(easy.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(schannel.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(curl_sspi.o) : error LNK2001: unresolved external symbol strdup
          libcurl_sys-0d9aaa1630205f23.rlib(altsvc.o) : error LNK2019: unresolved external symbol unlink referenced in function Curl_altsvc_save
          libcurl_sys-0d9aaa1630205f23.rlib(hsts.o) : error LNK2001: unresolved external symbol unlink
          libcurl_sys-0d9aaa1630205f23.rlib(cookie.o) : error LNK2001: unresolved external symbol unlink
          C:\Users\aminy\AppData\Local\Temp\cargo-installxKwFuC\release\deps\cargo_udeps-06db0f18527d4785.exe : fatal error LNK1120: 6 unresolved externals

@est31
Copy link
Owner

est31 commented Dec 31, 2021

@aminya that's interesting. Does it also reproduce if you clone the curl-rust repo and try the build there?

@aminya
Copy link
Author

aminya commented Dec 31, 2021

No, it works fine there! 🤔

image

@est31
Copy link
Owner

est31 commented Dec 31, 2021

@aminya what about cargo repo then? https://github.com/rust-lang/cargo ? Or some other repo that also uses cargo: https://github.com/kbknapp/cargo-outdated

@aminya
Copy link
Author

aminya commented Dec 31, 2021

Cargo fails to build with the same error!
However, I think I found the issue. I always use Clang as my CC and CXX compilers. After unsetting CC and CXX, I was able to build cargo and cargo-udeps!

@aminya aminya changed the title Fails to build on Windows Fails to build on Windows with Clang Dec 31, 2021
@est31
Copy link
Owner

est31 commented Dec 31, 2021

Alright, great that it worked. You can file an bug at the cargo repo about the clang issue, I'm closing this as it's an upstream issue.

@est31 est31 closed this as completed Dec 31, 2021
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