g3-io-ext 编译出错
Closed this issue · 2 comments
wsl2-archlinux编译,默认Features,请问怎么解决?
Compiling g3-io-ext v0.6.0 (/home/debu/git/rust/g3/lib/g3-io-ext) error: cannot construct
msghdrwith struct literal syntax due to private fields --> lib/g3-io-ext/src/udp/ext.rs:134:9 | 134 | libc::msghdr { | ^^^^^^^^^^^^ | = note: ...and other private fields
__pad1and
__pad2` that were not provided
error: cannot construct msghdr
with struct literal syntax due to private fields
--> lib/g3-io-ext/src/udp/ext.rs:179:9
|
179 | libc::msghdr {
| ^^^^^^^^^^^^
|
= note: ...and other private fields __pad1
and __pad2
that were not provided
error[E0308]: mismatched types
--> lib/g3-io-ext/src/udp/ext.rs:337:21
|
333 | libc::sendmmsg(
| -------------- arguments to this function are incorrect
...
337 | libc::MSG_DONTWAIT | libc::MSG_NOSIGNAL,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32
, found i32
|
note: function defined here
--> /home/debu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:828:12
|
828 | pub fn sendmmsg(
| ^^^^^^^^
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
337 | (libc::MSG_DONTWAIT | libc::MSG_NOSIGNAL).try_into().unwrap(),
| + +++++++++++++++++++++
error[E0308]: mismatched types
--> lib/g3-io-ext/src/udp/ext.rs:397:21
|
393 | libc::recvmmsg(
| -------------- arguments to this function are incorrect
...
397 | libc::MSG_DONTWAIT,
| ^^^^^^^^^^^^^^^^^^ expected u32
, found i32
|
note: function defined here
--> /home/debu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:834:12
|
834 | pub fn recvmmsg(
| ^^^^^^^^
help: you can convert an i32
to a u32
and panic if the converted value doesn't fit
|
397 | libc::MSG_DONTWAIT.try_into().unwrap(),
| ++++++++++++++++++++
For more information about this error, try rustc --explain E0308
.
error: could not compile g3-io-ext
(lib) due to 4 previous errors `
OK,谢谢你的回答与修复