Tengo una aplicación Gtk simple en Rust, pero recibo este error al compilar:
Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' foundY sí, leí No se puede compilar gstreamer en Windows porque falta glib-2.0 , pero aún no contiene toda la información que necesito.
Puse export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ en /home/user/.profile (como se muestra en Can't Set Environment Variables in ~/.profile ), y también lo ejecuté directamente en el directorio del proyecto Rust, en vano. Usé esa ruta porque parecía más cercana a la de la pregunta de Windows, aunque había muchos directorios pkgconfig en el sistema, en varios lugares.
Aquí está mi código de óxido:
use gtk::prelude::*; use gtk::{Application, ApplicationWindow}; fn main() { let app = Application::builder() .application_id("org.example.HelloWorld") .build(); app.connect_activate(|app| { // We create the main window. let window = ApplicationWindow::builder() .application(app) .default_width(320) .default_height(200) .title("Hello, World!") .build(); // Show the window. window.show(); }); app.run(); }y aquí está Cargo.toml:
[package] name = "gtk_test" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] gtk = { version = "0.2", package = "gtk4" } Entonces mi pregunta: ¿dónde está el archivo glib-2.0.pc en Linux? ¿Tiene otro nombre o hay que instalarlo?