I am using Eclipse Juno with GCC compiler for C code. I am trying to use gcno plugin to get code coverage.
of course I added -ftest-coverage -fprofile-arcs
to the compiler and the linker flags.
But, when I click on profiling tools for code coverage I get the error in the image below:
"Recompile at least one of your C/C++ source files with the "-fprofile-arcs" and "-ftest-coverage" options and link your executable with "-lgcov". If you compile and link in a single gcc call, you can use the gcc "--coverage" option. "
Please I need help with this error.
In order to use the gcov code coverage results you must not only compile with the compiler and linker flags you mentions, but you must also either run a unit test or run your program to gather the data. Gcov gathers the data as the points in your code are reached. If you do not run the program you will not generate any data.