Clion中的code全部飘红,bazel sync时报:Warning:cc target //search/search_helper:search_helper_test does not...

全线飘红时,发现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

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一如一代人的芳华已逝, 面目全非, 可他们依旧谈笑如故。 ...
    她的屋顶的鱼阅读 868评论 0 3
  • 欲戴王冠,必承其重。建筑越多的房屋,也就意味着,你可以散步的地方去变少了。想要什么,就会舍弃什么为代价。 为了赚六...
    hi滚滚阅读 168评论 0 0