Skip to content

Build fails on Windows platform. #59

@steelgeek091

Description

@steelgeek091
$ rustup toolchain list
stable-x86_64-pc-windows-msvc (active, default)

I'm using Windows 11 with the MSVC toolchain installed. When compiling the latest code from the master branch, I encountered the following error:

error[E0432]: unresolved import `std::os::fd`
 --> src\socket_util.rs:2:14
  |
2 | use std::os::fd::{FromRawFd, IntoRawFd};
  |              ^^ could not find `fd` in `os`
  |
note: found an item that was configured out
 --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181\library\std\src\os\mod.rs:182:9
note: the item is gated here
 --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181\library\std\src\os\mod.rs:181:1

warning: unused import: `std::path::PathBuf`
 --> src\tcp\tcp_server.rs:2:5
  |
2 | use std::path::PathBuf;
  |     ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `path_buf`
   --> src\tcp\tcp_server.rs:405:28
    |
405 |         BindLocation::Path(path_buf) => {
    |                            ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_path_buf`
    |
    = note: `#[warn(unused_variables)]` on by default

error[E0599]: no method named `into_raw_fd` found for struct `Socket` in the current scope
  --> src\socket_util.rs:94:25
   |
94 |     let raw_fd = socket.into_raw_fd();
   |                         ^^^^^^^^^^^ method not found in `Socket`

error[E0599]: no function or associated item named `from_raw_fd` found for struct `std::net::UdpSocket` in the current scope
  --> src\socket_util.rs:95:56
   |
95 |     let std_udp_socket = unsafe { std::net::UdpSocket::from_raw_fd(raw_fd) };
   |                                                        ^^^^^^^^^^^ function or associated item not found in `UdpSocket`
   |
note: if you're trying to build a new `std::net::UdpSocket`, consider using `std::net::UdpSocket::bind` which returns `Result<std::net::UdpSocket, std::io::Error>`
  --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181\library\std\src\net\udp.rs:120:5

warning: unused variable: `interface`
  --> src\socket_util.rs:77:21
   |
77 |     if let Some(ref interface) = bind_interface {
   |                     ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_interface`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
warning: `shoes` (bin "shoes") generated 3 warnings
error: could not compile `shoes` (bin "shoes") due to 3 previous errors; 3 warnings emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions