Home Comments Thread
New Thread

Install RGtk2 From Source on macOS - How to fix the problem "fatal error: 'gdk/gdkx.h' file not found" | /en/2018/01/install-rgtk2-macos/

yihui yihui 2022-12-17 02:05:27

Install RGtk2 From Source on macOS - How to fix the problem "fatal error: 'gdk/gdkx.h' file not found"

https://yihui.org/en/2018/01/install-rgtk2-macos/

3 Comments

giscus-bot giscus-bot 2022-12-17 02:05:28
访客 *hidelkys* @ 2018-01-29 17:21:56 写道:

今天偶然发现大牛的博客 请问还住在Elkhorn吗? 我就在UNL读书 没想到这么近…

yihui yihui 2022-12-17 02:05:30

在啊,我去 UNL 做过好几次报告。欢迎来玩!

——原帖发布于 2018-01-30 02:59:57

giscus-bot giscus-bot 2022-12-17 02:05:29
Guest *Ian* @ 2018-05-14 16:15:40 originally posted:

Brew formula for gtk+ no longer has --with-gdktarget or --enable-x11-backend options. So now what do we R homebrew "enthusiasts" do ...

yihui yihui 2022-12-17 02:05:31

Try this (no longer need to edit the gtk+ formula):

system('brew reinstall gtk+')
install.packages('RGtk2', type = 'mac.binary.el-capitan', repos = 'https://macos.rbind.org')

Originally posted on 2018-06-07 22:19:23

giscus-bot giscus-bot 2022-12-17 02:05:30
Guest *Cesar Terrer* @ 2019-05-29 14:26:07 originally posted:

Dear Yihue, I have successfully installed Rgtk2 using your code above, and I can do library(RGtk2) with no warning or error messages. However, when I run install.packages("cairoDevice") I get:

ERROR: gtk+2.0 not found by pkg-config.

ERROR: configuration failed for package ‘cairoDevice’

What did possibly go wrong with the installation of gtk+ that doesn't allow the installation of cairoDevice but allowed the installation of RGtk2?

yihui yihui 2022-12-17 02:05:32

I just rebuilt the cairoDevice binary on macos.rbind.io, so you can simply install the binary from this repo.

Originally posted on 2019-05-29 19:52:39

giscus-bot giscus-bot 2022-12-17 02:05:33
Guest *Cesar Terrer* @ 2019-05-30 05:05:25 originally posted:

Worked like a charm. You just saved me hours of frustration, thanks

Sign in to join the discussion

Sign in with GitHub