LoginSignup
0
0

【42 TOKYO】rl_replace_line関数のエラーを解決

Posted at

rl_replace_line関数のエラーを解決したので共有します。
ご参考になれば幸いです。

エラー内容

error: implicit declaration of function
      'rl_replace_line' is invalid in C99

原因

macのreadlineにrl_replace_line関数が定義されていない
※GNUのライブラリを入れる必要がある

解決方法

1. Readlineライブラリをインストールする

brew install readline

2. ライブラリをシステムにリンクする

brew link --force readline

3. ヘッダーファイルのパスを環境変数に追加する

echo 'export C_INCLUDE_PATH="$HOME/.brew/include:$C_INCLUDE_PATH"' >> ~/.zshrc

4. 設定を有効にする

echo 'export LIBRARY_PATH="$HOME/.brew/lib:$LIBRARY_PATH"' >> ~/.zshrc

5. ライブラリファイルのパスを環境変数に追加する

source ~/.zshrc
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