Piston: wl_interface not found in this scope

I want to get started with Piston. But I get the following error many times:

$ cargo run
error[E0412]: cannot find type `wl_interface` in this scope
-->  ./target/debug/build/wayland-client-cc3dcff01fc92bd0/out/wayland_c_interfaces.rs:632:47
632 |      unsafe { &wl_surface_interface as *const wl_interface },
    |                                               ^^^^^^^^^^^^ not found in this scope

I suppose it’s some C header that is missing? I get this error under ArchLinux with all software at the latest version. Please note that the wayland_c_interfaces.rs is not part of my code.

My minimal failing example is:


name = "gui_test"
version = "0.1.0"
authors = ["ampersand"]
edition = "2018"

piston_window = "0.98.0"


use piston_window::{PistonWindow, WindowSettings};

fn main() {
    let mut window: PistonWindow = WindowSettings::new( "Hello Piston!", [640, 480] );

I ripgrepped through /usr/include and found this definition:


struct wl_interface {
	/** Interface name */
	const char *name;
	/** Interface version */
	int version;
	/** Number of methods (requests) */
	int method_count;
	/** Method (request) signatures */
	const struct wl_message *methods;
	/** Number of events */
	int event_count;
	/** Event signatures */
	const struct wl_message *events;

But I do not know how to use it in my Rust program.

Sidenote: I also had to remove a lot of lines that only contained a semicolon in the generated files wayland_c_api.rs and wayland_c_interfaces.rs because these standalone semicolons created syntax errors.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.