系统:win110企业版
rust版本:1.38 stable
toolchain:x86_64-pc-windows-gnu
项目在本机可以正常编译,也可以正常debug调试(clion),但当我去用cargo装xargo和cross的时候(为了弄交叉编译),最后一步编译一直报undefined reference to __errno',这个我在rust社区搜过,没找到合适的解决方案,google也搜过,有没有大佬支支招。到底是少了哪个库?怎么弄? 详细错误信息如下: C:\Users\Administrator\AppData\Local\Temp\cargo-installUWgjsB\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(alloc.o):alloc.c:(.text$__rbt_backtrace_alloc+0x31): undefined reference to
__errno'
1
共 6 条评论, 1 页
评论区
写评论Xargo不再活跃维护了,不如试试Cargo-xbuild
但是我在装cross时候,也是这个错误,而且在mac上都是OK的,在win10上才报的这个 对以下内容的回复:
大佬,详细错误信息已贴出来了,请看下,具体问题是啥呢? 对以下内容的回复:
详细的错误信息如下: error: linking with gcc failed: exit code: 1 C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(alloc.o):alloc.c:(.text$__rbt_backtrace_alloc+0x31): undefined reference to __errno' C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(alloc.o):alloc.c:(.text$__rbt_backtrace_vector_grow+0xb1): undefined reference to__errno' C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(alloc.o):alloc.c:(.text$__rbt_backtrace_vector_finish+0x51): undefined reference to __errno' C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(alloc.o):alloc.c:(.text$__rbt_backtrace_vector_release+0x41): undefined reference to__errno' C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(posix.o):posix.c:(.text$__rbt_backtrace_open+0x2f): undefined reference to __errno' C:\Users\Administrator\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libbacktrace_sys-1b6210eebaee5bcd.rlib(posix.o):posix.c:(.text$__rbt_backtrace_open+0x39): more undefined references to__errno' follow
error: aborting due to previous error
error: failed to compile
xargo v0.3.16 (registry
https://mirrors.ustc.edu.cn/crates.io-index/)
, intermediate artifacts can be found atC:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7
Caused by: Could not compile
xargo
.Caused by: process didn't exit successfully:
rustc --crate-name xargo C:\Users\Administrator\.cargo\registry\src\mirrors.ustc.edu.cn-b63e9dae659fc205\xargo-0.3.16\src\main.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=9e255a2d6ed3a311 -C extra-filename=-9e255a2d6ed3a311 --out-dir C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps -L dependency=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps --extern dirs=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libdirs-567c174e2f5427e1.rlib --extern error_chain=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\liberror_chain-fce43448dc1f15b1.rlib --extern fs2=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libfs2-41bee84719c2b8cd.rlib --extern libc=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\liblibc-7ee814547abf838c.rlib --extern rustc_version=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\librustc_version-33c6144008cfc6f1.rlib --extern serde_json=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libserde_json-96bddb1bbd30e720.rlib --extern tempdir=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libtempdir-215e4bb85a623238.rlib --extern toml=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libtoml-beaa7c26857b6afc.rlib --extern walkdir=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\deps\libwalkdir-7fe345b1c083ae6d.rlib --cap-lints allow -L native=C:\Users\Administrator\.cargo\registry\src\mirrors.ustc.edu.cn-b63e9dae659fc205\winapi-x86_64-pc-windows-gnu-0.4.0\lib -L native=C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installTfUGP7\release\build\backtrace-sys-29468820f4dfe6ea\out
(exit code: 1)Xargo是为了编译libcore的,只适合那些官方没有分发二进制libstd的target,一般这种目标也不能用std,只能用core,因此应该标上
!#[no_std]
说好的 md 格式呢。
另外,错误信息是不是少了一大截,不够详细,看不出来啥。