LINK : fatal error LNK1181: cannot open input file 'harfbuzz.lib'

57 views Asked by At

I am new to rust and am setting up Rust on a new system, but I am having issues getting GTK4 to run. I created a simple "Hello World" program (opens a blank window titled "Hello World").

use gtk4 as gtk;

use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow};

const APP_ID: &str = "HelloWorld";

fn main() -> glib::ExitCode {
    // Create a new application
    let app = Application::builder().application_id(APP_ID).build();

    // Connect to the "activate" signal of `app`
    app.connect_activate(build_ui);

    // Run the application
    app.run()
}

fn build_ui(app: &Application) {
    // Create a window and set the title
    let window = ApplicationWindow::builder()
        .application(app)
        .title("Hello, World!")
        .build();

    // Connect the close button to end the program
    window.connect_close_request(|window| {
        window.close();
        glib::Propagation::Proceed
    });

    // Present window
    window.present();
}

This runs as expected on the original computer, but when I tried running it on the new system, I get LINK : fatal error LNK1181: cannot open input file 'harfbuzz.lib'. What makes this error especially confusing is that I cannot find the file 'harfbuzz.lib' on my original system.

I have tried a number of ways to fix this problem:

  • Reinstalling GTK4 via msys2
  • Ensuring all msys2 packages installed on the original system are installed on the new system
  • Uninstalling and reinstalling Visual Studio Build Tools 2019
  • Ensuring all PATH variables are linked
  • Downloading Harfbuzz from GitHub and msys2 (I could not find a 'harfbuzz.lib' file)

What might work (but I don't know how to do):

  • Checking that both systems are using the same linker
  • Compiling Harfbuzz manually

Any help would be greatly appriciated, Thank You.

0

There are 0 answers