Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on FreeBSD: error[E0433]: failed to resolve: use of undeclared crate or module libc #52

Closed
yonas opened this issue Dec 12, 2023 · 2 comments · Fixed by #53
Closed

Comments

@yonas
Copy link

yonas commented Dec 12, 2023

$ cargo build --release
...
   Compiling clap_derive v4.4.7
   Compiling parse_duration v2.1.1
error[E0433]: failed to resolve: use of undeclared crate or module `libc`
  --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:25:18
   |
25 |         unsafe { libc::freeifaddrs(self.base) }
   |                  ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
  --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:31:20
   |
31 |     match unsafe { libc::getifaddrs(addr.as_mut_ptr()) } {
   |                    ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
 --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:5:16
  |
5 |     base: *mut libc::ifaddrs,
  |                ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
 --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:6:16
  |
6 |     next: *mut libc::ifaddrs,
  |                ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
  --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:10:17
   |
10 |     type Item = libc::ifaddrs;
   |                 ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
  --> /home/yonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/network-interface-1.1.1/src/target/getifaddrs.rs:30:44
   |
30 |     let mut addr = mem::MaybeUninit::<*mut libc::ifaddrs>::uninit();
   |                                            ^^^^ use of undeclared crate or module `libc`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `network-interface` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...

OS: FreeBSD 14.0-RELEASE
rustc 1.76.0-nightly

@ikatson
Copy link
Owner

ikatson commented Dec 12, 2023

Checked on a FreeBSD VM - compiles now. Needed to fork network-interfaces lib

@yonas
Copy link
Author

yonas commented Dec 12, 2023

@ikatson Thanks 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants