首先,我的Mac OS版本是10.11.3(El Capitan)。
所以,我正在通过http://c.learncodethehardway.org/book/学习c。这是Zed A. Shaw的教程。在那个教程中,他让读者安装了Valgrind。步骤如下:
if($('#name_of_the_controller').length) { console.log('do something') }
所以,我按上述方法做了并且在第4步陷入困境。如果我没有弄错,命令行说没有目标可以制作(类似的东西)。我意识到它不是Valgrind的最新版本,所以通过完全按照上述步骤,我已经设法安装了最新的版本。我设法直到第5步,尽管有时在安装过程中命令行会出现一些负面消息。
问题是,每当我输入valgrind时,命令都会打印# 1) Download it (use wget if you don't have curl)
curl -O http://valgrind.org/downloads/valgrind-3.6.1.tar.bz2
# use md5sum to make sure it matches the one on the site
md5sum valgrind-3.6.1.tar.bz2
# 2) Unpack it.
tar -xjvf valgrind-3.6.1.tar.bz2
# cd into the newly created directory
cd valgrind-3.6.1
# 3) configure it
./configure
# 4) make it
make
# 5) install it (need root)
sudo make install
。然后通过-bash: valgrind: command not found
打印此消息:
brew doctor
当我输入Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
valgrind
时,会打印出此消息:
brew link valgrind
我甚至试过Linking /usr/local/Cellar/valgrind/3.11.0...
Error: Could not symlink include/valgrind/callgrind.h
/usr/local/include/valgrind is not writable.
并打印出此消息:
brew install --HEAD valgrind
发生了什么事?我怎样才能解决这个问题?发生这件事是因为我之前使用Warning: valgrind-3.11.0 already installed, it's just not linked
命令尝试安装过时的Valgrind时出错了(虽然如果我没记错的话,make
命令当时无法执行)?