You have, I would guess, run into the Static Initialization Order
Fiasco, as detailed in the C++ FAQ Lite at
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12. Somewhere
in the internals of the implementation of gmock there are presumably
some static registries of mock objects (or equivalent), which are, due
to an essentially random decision of your compiler, not being
initialized before your own static object is. Therefore, your implicit
attempt to access them caused by your call to EXPECT_CALL is crashing.
A sensible way to get around this, assuming it is the problem, is to
use the Construct On First Use idiom, instead of directly creating a
global object. It's not worth my detailing that in full here, because
it's also described in the C++ FAQ Lite immediately below the previous
link.
Of course, if this is the problem, then maybe the implementation of
gmock should be doing the same thing...
Hope this helps,
JJ