Clion中的code全部飘红,bazel sync时报:War

2018-12-11  本文已影响0人  krystollia

全线飘红时,发现toolchain跟别人不一样,别人是gmake,我的是cmake,然后发现系统里找不到gmake。。。

  1. 安装gmake
    尝试了很多篇文章里说的方法,只有一种方法管用,就是下载源码包然后手动安装。

下载:
https://www.gnu.org/software/make/,段落 Downloading Make。
下载地址:

http://ftp.gnu.org/gnu/make/

下载的是最新版本4.2。
安装:
https://stackoverflow.com/questions/47476398/upgrade-gnu-make-on-mac

# Download gnu make-4.1.tar.gz from gnu website.
./configure
make 
sudo make install

参考https://github.com/bazelbuild/intellij/issues/109中下面的方法:

Setting up BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 worked for me
Meaning running from the command line:

export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1

before starting CLion and then opening CLion from the command line:

open /Applications/CLion.app
  1. File -> Invalid caches / restart
  2. 再次 Sync project with build files

依次做了上述操作,不知道哪个是最关键的步骤。然后就奇迹般地不飘红了,太开心了😝

上一篇下一篇

猜你喜欢

热点阅读