How to install valgrind good?

和自甴很熟 提交于 2019-12-23 00:51:22

问题


I'm installing valgrind now, until the ‘make install’ command it goes good. The next command- ‘make regtest’ outputs the next error:

../../depcomp: line 689: exec: g++: not found
make[5]: *** [leak_cpp_interior.o] Error 127
make[5]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/kbubuntu/valgrind-3.9.0'
make: *** [check] Error 2

How can I solve it?

Thanks.


回答1:


All major linux distributions will include valgrind in their repositories. You can find this on debian derived, apt based systems with:

apt search valgrind

But first just try:

apt install valgrind

It should work, and pull in any dependencies. Remember, if you are not the superuser, you'll need to preface those with sudo.

It's a great tool, have fun.




回答2:


Make from source.

Download valgrind source code from here.

  1. Decompression
  2. run ./configure --prefix=$HOME/valgrind
  3. run make install
  4. append 2 lines in ~/.bashrc:

    export PATH=$PATH:$HOME/valgrind/bin

    export VALGRIND_LIB="$HOME/valgrind/lib/valgrind"

  5. run source ~/.bashrc....done

Try to run which valgrind.




回答3:


i think its due to dependency not met. install g++ by

sudo apt-get install g++

then try again. error is due to exec is unable to find any package named g++



来源:https://stackoverflow.com/questions/24935217/how-to-install-valgrind-good

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!