Question: I've been building a static library to share between multiple iOS projects, and I want to use gcov (or any code coverage analysis tool) to tell me where I'm missing my tests. However, when I enable gcov by following these directions: <http://supermegaultragroovy.com/blog/2005/11/03/unit-testing-and-code-coverage-with-xcode/>

I get this error from Libtool:

> 
> 
> ```
> /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lgcov
> /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lgcov is not an object file (not allowed in a library)
> 
> ```
> 
> 

For some reason XCode4 can't find the libgcov.a file. It is in many places on my system but for some reason it can't be found. I'm fairly new to XCode, and gcc based programming in general, so I'm not sure how I can fix this, my guess is that I just have to tell it specifically where to find libgcov.a but I'm not sure how to go about that.

Answer: 
Looks like I found a solution. Crazy XCode seems to treat static libraries completely different when invoking gcc. And I thought MSBuild was a build system from hell... it's a snap and at least there are books about it.

Anyway, here's how you do it:
Add `$(PLATFORM_DEVELOPER_USR_DIR)/lib` to your "Library Search Paths" build setting for your static library and tick the "Recursive" check box.

Works for me, let me know if it works for you.
This may help in solving your issue, have a look in to it
[GTM](http://code.google.com/p/google-toolbox-for-mac/wiki/SnowLeopardGCov)