本文介绍了g ++,colorgcc和ccache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

试图结合ccache和colorgcc。遵循:


  • 我的g ++是softg链接到colorgcc

  • 〜/ .colorgccrc包含行:g ++:ccache / usr / bin / g ++


运行g ++时--version接收:

 不能执行ccache / usr / bin / gcc:在/usr/lib/perl5/5.8.8/IPC/Open3.pm第246行没有这样的文件或目录。
open3:ccache / usr / bin / gcc的exec --version在/ usr / local / bin / colorgcc / gcc下失败208

任何想法如何解决它?

解决方案

刚刚遇到同样的问题。对我来说,可以通过仔细设置环境变量来解决问题:

 #使用g ++命令调用colorgcc 
export PATH =/ usr / lib / colorgcc / bin:$ PATH

#告诉ccache调用/ usr / bin中的编译器
export CCACHE_PATH =/ usr / bin

然后我只需要编辑colorgcc的配置文件( / etc / colorgcc / colorgcc 〜/ .colorgcc ),然后告诉它调用ccache:

<$ p / usr / lib / ccache / bin / gcc
c ++:/ usr / lib / ccache / usr / lib / ccache / bin / g ++
gcc:/ usr / lib / bin / g ++
cc:/ usr / lib / ccache / bin / gcc
g77:/ usr / lib / ccache / bin / g77
f77:/ usr / lib / ccache / bin / g77
gcj:/ usr / lib / ccache / bin / gcj

这当然只有如果在 / usr / lib / colorgcc / bin 中安装了colorgcc的符号链接,并且在 / usr / lib / ccache / bin - 相应地调整。


Trying to combine ccache and colorgcc. Following link text:

  • my g++ is soft link to colorgcc
  • ~/.colorgccrc contains line: "g++: ccache /usr/bin/g++"

When running g++ --version receive:

Can't exec "ccache  /usr/bin/gcc": No such file or directory at /usr/lib/perl5/5.8.8/IPC/Open3.pm line 246.
open3: exec of ccache  /usr/bin/gcc --version failed at /usr/local/bin/colorgcc/gcc line 208

Any ideas how to solve it?

解决方案

Just came across this same issue. For me, the problem could be solved by carefully setting environment variables:

# Make "g++" command call colorgcc
export PATH="/usr/lib/colorgcc/bin:$PATH"

# Tell ccache to invoke compilers in /usr/bin
export CCACHE_PATH="/usr/bin"

Then all I had to do was edit colorgcc's config file (/etc/colorgcc/colorgcc or ~/.colorgcc) and tell it to call ccache instead:

g++: /usr/lib/ccache/bin/g++
gcc: /usr/lib/ccache/bin/gcc
c++: /usr/lib/ccache/bin/g++
cc:  /usr/lib/ccache/bin/gcc
g77: /usr/lib/ccache/bin/g77
f77: /usr/lib/ccache/bin/g77
gcj: /usr/lib/ccache/bin/gcj

This of course only works if you have colorgcc's symlinks installed in /usr/lib/colorgcc/bin and ccache's symlinks in /usr/lib/ccache/bin - adjust accordingly.

这篇关于g ++,colorgcc和ccache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 01:40