Can't Compile GTK Hello World App

Hello,

I am trying to compile a simple gtk hello world window app. The source code is here:

https://github.com/coltonhurst/hello-window/blob/master/src/main.rs

When I run cargo run, I get a massive error:

error: linking with `cc` failed: exit code: 1

/// a bunch of text here ///

= note: ld: library not found for -lgtk-3
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `hello-window`.

I am running OS X and running cc -v gives Apple clang version 11.0.3 (clang-1103.0.32.62)

Please help- thank you!!

Do you have gtk 3 installed?

1 Like

I have it installed with hombrew (brew install gtx+). Maybe that's not enough?

It looks like the gtk+ package is for gtk 2.

Try brew install gtk+3.

1 Like

That was it- thank you!

I should have checked that...

(I wish I could mark both as the solution)

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.