LoginSignup
0
0

More than 1 year has passed since last update.

MacでXWindowを動作させる

Posted at

どういうことするの

Mac上のC言語でXWindowを操作するので、環境構築をしたい。

環境

macOS Catalina 10.15.7 (macOS 13? でも動作確認済み)

インストール

brew編

いつもお世話になっております。ターミナルで以下を入力する。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

管理者権限を持っている人のアカウントで入って、パスワード入力してインストールする。

XQuartz編

ターミナルで以下を入力し、インストールする

brew install --cask xquartz

もしくは公式ウェブからpkgをダウンロードし、インストールする。

Xlib編

上をインストールしても、以下のようなエラーが出るのでXlibをインストールする。

main.c:6:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h> // XWindow
         ^~~~~~~~~~~~
1 error generated.

ターミナル上で以下を入力し、インストールする。

brew install libx11

まだエラーが出る場合

これでもできない場合、パスがあってない可能性がある。ここでどこにあるのか示したいがパスを忘れたので助けてください。(適当すいません)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0