Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the compiler does not recognize Google Mock wildcard?

When I try to use:

ON_CALL(mock, foo(_))

Compilation error is thrown:

Error   1   error C2065: '_' : undeclared identifier    

I am using visual studio 2012.

like image 389
User234 Avatar asked Jan 28 '15 06:01

User234


1 Answers

undeclared identifier always means that compiler does not understand what it (i.e. _) is. So perhaps you forgot

#include <gtest/gtest.h>
#include <gmock/gmock.h>

or

using::testing::_;

Refer to examples and check.

like image 120
VolAnd Avatar answered Oct 11 '22 08:10

VolAnd