尝试在32位Windows 10计算机上编译https://github.com/gifnksm/twitter-api-rs处给出的示例,我收到以下错误 - 有关该怎么做的任何想法?
(我之前遇到curl-sys编译问题,需要将环境变量CFLAGS设置为'-mmmx -msse')
D:\Proj\Rust\projects\twittest>cargo build --verbose
Fresh rustc-serialize v0.3.16
Fresh pkg-config v0.3.5
Fresh libc v0.1.10
Fresh winapi v0.2.2
Fresh winapi-build v0.1.1
Fresh matches v0.1.2
Fresh log v0.3.2
Fresh url v0.2.37
Fresh advapi32-sys v0.1.2
Fresh kernel32-sys v0.1.4
Fresh rand v0.3.11
Fresh gcc v0.3.13
Fresh time v0.1.32
Compiling curl-sys v0.1.25
Running `D:\Proj\Rust\projects\twittest\target\debug\build\curl-sys-865cd014190c57f1\build-script-build`
Fresh libz-sys v0.1.8
Fresh rust-crypto v0.2.31
failed to run custom build command for `curl-sys v0.1.25`
Process didn't exit successfully: `D:\Proj\Rust\projects\twittest\target\debug\build\curl-sys-865cd014190c57f1\build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=D:\Proj\Rust\projects\twittest\target\debug\build\curl-sys-865cd014190c57f1\out/lib
cargo:rustc-link-lib=static=curl
cargo:root=D:\Proj\Rust\projects\twittest\target\debug\build\curl-sys-865cd014190c57f1\out
cargo:include=D:\Proj\Rust\projects\twittest\target\debug\build\curl-sys-865cd014190c57f1\out/include
cargo:rustc-flags=-l ws2_32
curlsys running: "sh" "-c" "/c/Users/Me/.cargo/registry/src/github.com-121aea75f9ef2ce2/curl-sys-0.1.25/curl/configure --with-winssl --enable-static=yes --enable-shared=no --enable-optimize --prefix=D:/Proj/Rust/projects/twittest/target/debug/build/curl-sys-865cd014190c57f1/out --without-librtmp --without-libidn --without-libssh2 --without-nghttp2 --disable-ldap --disable-ldaps --disable-ftp --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual"
--- stderr
thread '<main>' panicked at 'cmd.status() return the error The system cannot find the file specified.
(os error 2)', C:\Users\Me\.cargo\registry\src\github.com-121aea75f9ef2ce2\curl-sys-0.1.25\build.rs:134
我正在使用http://mingw-w64.org,但我怀疑问题在于库中的32位构建参数配置sh文件(可能!)
答案 0 :(得分:0)
我的猜测是--prefix=D:/Proj/...
部分错误,应该是--prefix=/d/Proj/...
。
在https://github.com/carllerche/curl-rust/blob/master/curl-sys/build.rs#L110中,有一个硬编码的replace("C:\\", "/c/")
但没有处理其他单位标签。
换句话说,当你的项目根目录不在C:
时,curl-rust似乎不支持构建。是否可以移动项目目录,或至少移动此项目的代码?