Giter Club home page Giter Club logo

Comments (9)

pvginkel avatar pvginkel commented on May 21, 2024

The problem is that the gcc version bundled with Rust does not define strtok_r, and the MinGW version does. The solution is to change the installation of Rust to not install the bundled gcc. If you re-run the setup; choose "Change", click the drop down before "Linker and platform libraries" and choose "The entire feature will be unavailable", the compilation should work.

from curl-rust.

alexcrichton avatar alexcrichton commented on May 21, 2024

I tracked this down awhile ago and unfortunately the problem is:

  • libcurl is compiling with the system gcc and is detecting a newer feature, the strtok_r function.
  • When the compiler links the crate, it uses a bundled gcc version
  • This bundled gcc version uses its own libraries, which don't have the detected function.

Unfortunately the only fix here is to just delete the bundled linker that comes with Rust (or uncheck the box during the install).

from curl-rust.

masaeedu avatar masaeedu commented on May 21, 2024

@alexcrichton What is the equivalent to "unchecking the box during install" for installs with rustup?

from curl-rust.

alexcrichton avatar alexcrichton commented on May 21, 2024

@masaeedu unfortunately I don't know of a great way to do that. My personal way to work around this is to always install the MSVC host toolchain and then target pc-windows-gnu, that way these components aren't picked up

from curl-rust.

masaeedu avatar masaeedu commented on May 21, 2024

@alexcrichton I've also tried the MSVC toolchain, but this package seems to break with that as well, with the following error message:

Couldn't find libcurl from pkgconfig ("MSVC target detected. If you are using the MSVC ABI rust build, please use the GNU ABI build instead."), compiling it from source...

I'm trying to install https://github.com/killercup/cargo-edit, which depends on curl, using cargo install cargo-edit. If I use the GNU toolchain via rustup default stable-gnu, I get the strtok_r issue. If I use the MSVC toolchain via rustup default stable-msvc I get the message I pasted above. Any ideas on how to proceed are greatly appreciated.

from curl-rust.

alexcrichton avatar alexcrichton commented on May 21, 2024

@masaeedu that looks more like an informational message than an error maybe? Could you gist the full build log?

from curl-rust.

masaeedu avatar masaeedu commented on May 21, 2024

@alexcrichton Sure. Here you go: https://gist.github.com/masaeedu/475aa03570af8f548430f85652071530

from curl-rust.

alexcrichton avatar alexcrichton commented on May 21, 2024

Oh the actual build there is:

curl_setup.h(132): fatal error C1083: Cannot open include file: 'curl/curlbuild.h': No such file or directory

That's building an ancient version of curl-sys though (0.1.*) which has had tons of bug fixes since then. Unfortunately though it doesn't look like you control the version being used :(

from curl-rust.

masaeedu avatar masaeedu commented on May 21, 2024

I guess cargo-edit's depending on an old version of curl, which in turn pulls in an old version of curl-sys. I'll go file a bug there. Thanks.

from curl-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.