gcov out of memory / mismatched version?

后端 未结 3 1238
轮回少年
轮回少年 2021-02-05 06:25

Just trying to get gcov up and running, getting the following error:

$ gcov src/main.c -o build
build/main.gcno:version \'404*\', prefer \'407*\'

gcov: out of m         


        
3条回答
  •  -上瘾入骨i
    2021-02-05 07:03

    My problem was that I updated gcc and g++ so that I could use a newer compiler, but forgot to update the gcov version meaning running "gcov" or "lcov" picked up the previous compilers version of gcov.

    So basically running g++ --version and gcov --version should yield the same version number else things are going to go very wrong.

    Here is how I updated my compiler version, the last line being what I was missing to get it all working.

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 90
    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
    sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90
    

提交回复
热议问题