Importing libc::windows module

Hi

I am trying to import the particular module windows from the libc crate (libc::windows - Rust). However, I keep getting the errors no `windows` in the root and could not find `windows` in `libc. Is this the right way to import modules?

Also, do I need to compile this on a Windows machine?

extern crate libc;

use libc::windows;
....

https://github.com/rust-lang/libc/blob/159a305a0f23f78db504409d80afcce96a177992/src/lib.rs#L103-L104

windows is a private module. Everything in there is re-exported in the crate root.

Sorry for my ignorance @bjorn3 , I am not too sure what that means. Could you give a simple example?

It means you can't do use libc::windows but you don't need it either.

When using this crate, doing this:

use libc;

is the equivalent of:

use libc::windows;

You do not have access to libc::windows but that's ok because it exports everything under libc instead. That's what the lines bjorn3 quoted means.

I see, thanks for the help

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.