Jayashree Ramani <rjayash...@yahoo.com> writes: > Hello GCC Experts,
This message should have been sent to gcc-h...@gcc.gnu.org rather than g...@gcc.gnu.org. Please send any followups to gcc-help. > > I am an engineer trying to run gcov for our unit tests. We have a couple > of DLLs and a few static libraries. > > I am having trouble linking the Test program that links in the DLLs. I > have the following in the Cmake files: > > IF( "${COVERAGE}" STREQUAL "TRUE" ) > LINK_DIRECTORIES(/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3) > TARGET_LINK_LIBRARIES( NWATest analytics TestUtils ${SYSTEM_LIBS} ) > ENDIF( "${COVERAGE}" STREQUAL "TRUE" ) gcc 3.3.3 is quite old at this point. > But I get the following errors: > > /bin/ld: NWATest: hidden symbol `__gcov_init' in > /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/libgcc.a(_gcov.oS) is referenced > by DSO The error message means that some shared library is calling __gcov_init, which is a hidden symbol. The way to fix this is to make sure that you pass the --coverage option when you link the shared library. At least, that will do the right thing with current gcc; I don't know for sure that it will work with gcc 3.3.3. Ian