Cannot install gcov without version suffix

1.2k Views Asked by At

I try to install gcov to be able to generate coverage reports. I'm on machine Ubuntu 19.04 and have installed gcov-8, which is working pretty well.

The problem is (as I can understand) that lcov tries to use gcov instead gcov-8. If I install gcc-9, the gcov is going to be installed, but in this case, I'm getting version mismatch problems.

Can anyone help me to figure out what to do to?

2

There are 2 best solutions below

0
On BEST ANSWER

The problem resolved. Just removed and reinstalled gcc.

0
On

On Ubuntu there is a standard approach using update-alternatives command

update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-8 800

Which is basically almost the same as creating a symlink from /usr/bin/gcov to /usr/bin/gcov-8, but has better maintainability

800 is just a random number, "priority" which will make sense only when you have several alternatives