tags:

views:

11

answers:

1

When adding gcov to an Xcode project, I'm getting linker errors: the symbols __gcov_init and __gcov_merge_add are not found.

This is on Mac OS X 10.5 and Xcode 3.1.4, it's a Quartz Composer Plugin project and I'm trying to add gcov to the OCUnit test cases target. The Base SDK and Deployment Target are both set to Mac OS X 10.5. The GCC version is set to 4.0.

I was able to successfully create another (very simple) Quartz Composer Plugin project with gcov and OCUnit. I may be missing something but the build settings between the two projects seemed identical in anything that could possibly affect gcov linkage. (The only differences I see are the C Language Dialect, some extra settings in the not-working project for Interface Builder Compiler, and a user-defined setting that runs Clang.)

Any suggestions would be appreciated.

A: 

Shaggy Frog had the right idea-- the -lgcov flag was not appearing in the output. My project had a unit testing target and separate configurations for with and without coverage. The Other Linker Flags setting was different in the unit testing target and the coverage configuration, with -lgcov being set in only one of those. Instead of adding in all of the flags, Xcode was overriding one set of flags with the other.

jlstrecker