Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

892
Visualizações
Where is the `glib-2.0` file on Linux?

I have a simple Gtk app in Rust, but I get this error when compiling:

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' found

And yes, I read Cannot compile gstreamer on Windows because it is missing glib-2.0, but it still doesn't contain all the information I need.

I put export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ in /home/user/.profile (as shown in Can't Set Environment Variables in ~/.profile), and I also ran it directly in the Rust project directory, to no avail. I used that path because it seemed closest to the one in the Windows question, though there were many pkgconfig directories on the system, in various places.

Here is my Rust code:

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();
}

and here is 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" }

So my question: where is the glib-2.0.pc file on a Linux? Is it under a different name, or does it have to be installed?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda