Get gtest to run tests from static libs under msvc
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Google Test is a great testing framework for C++, but it doesnt play nicely with msvc and static libraries. see

This python script can be used to generate a header from a static library. This header has appropriate pragmas to force the linker to link in all the tests from the static library.

Usage libfile headerfile Then just include that header in your test harness.

I recommend you run this as a post build step for your static library.


  • upload a py2exed version for those people that dont have python installed.
  • add extra test frameworks. Ive had this same problem with other ones in the past