TMPDIR=..
PROJECT_ROOT=..
GMOCK_LIB = -L/opt/gtest/lib
GMOCK_INCLUDE = -I/opt/gtest/include -I/usr/include/gtest/ -I/usr/include/gmock/ -I$(PROJECT_ROOT)
[root@SUT example]# make all
g++ -g -O0 -std=c++11 -fno-inline -falign-functions=32 test_member_function.cpp -I/opt/gtest/include -I/usr/include/gtest/ -I/usr/include/gmock/ -I.. -L/opt/gtest/lib -o ../test_member_function.out
In file included from ../impl.h:12:0,
from ../internal_macro.h:11,
from ../cpp_free_mock.h:12,
from test_member_function.cpp:16:
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = std::basic_string<char>; P = {const void*}]’:
test_member_function.cpp:102:5: required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*)>&’ from an rvalue of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*)>’
return gmocker.With(p ...);
^
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = std::basic_string<char>; P = {const void*, bool, char, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’:
test_member_function.cpp:114:5: required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*, bool, char, int, std::basic_string<char>, const std::basic_string<char>&)>&’ from an rvalue of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*, bool, char, int, std::basic_string<char>, const std::basic_string<char>&)>’
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = int; P = {const void*, bool&, char&, int&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’:
test_member_function.cpp:136:5: required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<int(const void*, bool&, char&, int&, std::basic_string<char>&, const std::basic_string<char>&)>&’ from an rvalue of type ‘testing::internal::MockSpec<int(const void*, bool&, char&, int&, std::basic_string<char>&, const std::basic_string<char>&)>’
make: *** [test_member_function] Error 1
Not sure what I am missing..
Any guidance on same will be helpful..