Не могу скомпилировать мой тест Google

Вчера GoogleMock и GoogleTest работали нормально, фактически я использую их последние 5 лет. Сегодня неожиданно я не могу создать файл, который ссылается на gmock/gmock.h файл, и я получаю следующее.

|| [ninja -C ~/HydroGuardFW/hg_os/build -f ../temp/unittest/temp_test.ninja && valgrind ./build/temp_test]
|| ninja: Entering directory `/home/sporty/HydroGuardFW/hg_os/build'
|| [1/2] Compiling cpp object temp_test.o
|| FAILED: temp_test.o 
|| clang++ '-isystem../../googletest/googletest/include'  '-isystem../../googletest/googlemock/include'  '-I..' '-I../../hw_1_5' -g -Wall -Wextra -pthread '-pipe' -std=c++14 -Wno-unknown-pragmas  -Wno-missing-field-initializers -MMD -MP -DUNITTEST '-MQ' temp_test.o '-MF' 'temp_test.d' -o temp_test.o -c ../temp/unittest/temp_test.cpp
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:46:
|| In file included from ../../googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:42:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/ostream:38:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/ios:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/basic_ios.h:37:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/locale_facets.h:48:
/usr/include/c++/7.3.1/bits/streambuf_iterator.h|140 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_inc_istreambuf)
||                                            ^
/usr/include/c++/7.3.1/bits/streambuf_iterator.h|155 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_inc_istreambuf)
||                                            ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:46:
|| In file included from ../../googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47:
|| In file included from ../../googletest/googletest/include/gtest/gtest.h:62:
|| In file included from ../../googletest/googletest/include/gtest/gtest-param-test.h:192:
|| In file included from ../../googletest/googletest/include/gtest/internal/gtest-param-util.h:39:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/iterator:66:
/usr/include/c++/7.3.1/bits/stream_iterator.h|81 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_deref_istream)
||                                            ^
/usr/include/c++/7.3.1/bits/stream_iterator.h|93 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_inc_istream)
||                                            ^
/usr/include/c++/7.3.1/bits/stream_iterator.h|103 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_inc_istream)
||                                            ^
/usr/include/c++/7.3.1/bits/stream_iterator.h|197 col 16| error: use of undeclared identifier '__gnu_debug'
||                                 _M_message(__gnu_debug::__msg_output_ostream)
||                                            ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|1246 col 2| error: use of undeclared identifier '__glibcxx_requires_string'
||         __glibcxx_requires_string(__s);
||         ^
/usr/include/c++/7.3.1/bits/basic_string.h|5917 col 13| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append' requested here
||       __str.append(__rhs);
||             ^
/usr/include/c++/7.3.1/system_error|351 col 28| note: in instantiation of function template specialization 'std::operator+<char, std::char_traits<char>, std::allocator<char> >' requested here
||     : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { }
||                            ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|1911 col 2| error: use of undeclared identifier '__glibcxx_requires_string_len'
||         __glibcxx_requires_string_len(__s, __n2);
||         ^
/usr/include/c++/7.3.1/bits/basic_string.h|1613 col 22| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace' requested here
||       { return this->replace(__pos1, size_type(0),
||                      ^
/usr/include/c++/7.3.1/bits/basic_string.h|5959 col 39| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert' requested here
||       return __cond ? std::move(__rhs.insert(0, __lhs))
||                                       ^
/usr/include/c++/7.3.1/system_error|351 col 35| note: in instantiation of function template specialization 'std::operator+<char, std::char_traits<char>, std::allocator<char> >' requested here
||     : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { }
||                                   ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|1679 col 2| error: use of undeclared identifier '__glibcxx_requires_string'
||         __glibcxx_requires_string(__s);
||         ^
/usr/include/c++/7.3.1/bits/basic_string.h|5967 col 30| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert' requested here
||     { return std::move(__rhs.insert(0, __lhs)); }
||                              ^
/usr/include/c++/7.3.1/system_error|354 col 36| note: in instantiation of function template specialization 'std::operator+<char, std::char_traits<char>, std::allocator<char> >' requested here
||     : runtime_error(__what + (": " + __ec.message())), _M_code(__ec) { }
||                                    ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|1680 col 15| error: no matching member function for call to 'replace'
||         return this->replace(__pos, size_type(0), __s,
||                ~~~~~~^~~~~~~
/usr/include/c++/7.3.1/bits/basic_string.h|1957 col 7| note: candidate function not viable: no known conversion from 'const char *' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') for 3rd argument; dereference the argument with *
||       replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|1995 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2038 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2, size_type __n,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2106 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2095 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2117 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2128 col 7| note: candidate function not viable: no known conversion from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::__const_iterator' (aka '__normal_iterator<const char *, std::__cxx11::basic_string<char> >') for 1st argument
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2065 col 9| note: candidate template ignored: deduced conflicting types for parameter '_InputIterator' ('const char *' vs. 'unsigned long')
||         replace(const_iterator __i1, const_iterator __i2,
||         ^
/usr/include/c++/7.3.1/bits/basic_string.h|1861 col 7| note: candidate function not viable: requires 3 arguments, but 4 were provided
||       replace(size_type __pos, size_type __n, const basic_string& __str)
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2153 col 21| note: candidate function not viable: requires 3 arguments, but 4 were provided
||       basic_string& replace(const_iterator __i1, const_iterator __i2,
||                     ^
/usr/include/c++/7.3.1/bits/basic_string.h|1933 col 7| note: candidate function not viable: requires 3 arguments, but 4 were provided
||       replace(size_type __pos, size_type __n1, const _CharT* __s)
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|1975 col 7| note: candidate function not viable: requires 3 arguments, but 4 were provided
||       replace(__const_iterator __i1, __const_iterator __i2,
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|2017 col 7| note: candidate function not viable: requires 3 arguments, but 4 were provided
||       replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s)
||       ^
/usr/include/c++/7.3.1/bits/basic_string.h|1883 col 7| note: candidate function not viable: requires 5 arguments, but 4 were provided
||       replace(size_type __pos1, size_type __n1, const basic_string& __str,
||       ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:43:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/algorithm:61:
/usr/include/c++/7.3.1/bits/stl_algobase.h|729 col 7| error: use of undeclared identifier '__glibcxx_requires_valid_range'
||       __glibcxx_requires_valid_range(__first, __last);
||       ^
/usr/include/c++/7.3.1/bits/stl_bvector.h|402 col 7| note: in instantiation of function template specialization 'std::fill<unsigned long *, int>' requested here
||         std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
||              ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:43:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/algorithm:61:
/usr/include/c++/7.3.1/bits/stl_algobase.h|452 col 7| error: use of undeclared identifier '__glibcxx_requires_valid_range'
||       __glibcxx_requires_valid_range(__first, __last);
||       ^
/usr/include/c++/7.3.1/bits/stl_bvector.h|1142 col 7| note: in instantiation of function template specialization 'std::copy<const bool *, std::_Bit_iterator>' requested here
||         std::copy(__first, __last, this->_M_impl._M_start);
||              ^
/usr/include/c++/7.3.1/bits/stl_bvector.h|1123 col 9| note: in instantiation of function template specialization 'std::vector<bool, std::allocator<bool> >::_M_initialize_range<const bool *>' requested here
||       { _M_initialize_range(__first, __last, 
||         ^
/usr/include/c++/7.3.1/bits/stl_bvector.h|667 col 9| note: in instantiation of function template specialization 'std::vector<bool, std::allocator<bool> >::_M_initialize_dispatch<const bool *>' requested here
||       { _M_initialize_dispatch(__first, __last, __false_type()); }
||         ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googletest/include/gtest/internal/gtest-param-util.h|296 col 9| note: in instantiation of function template specialization 'std::vector<bool, std::allocator<bool> >::vector<const bool *, void>' requested here
||       : container_(begin, end) {}
||         ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googletest/include/gtest/gtest-param-test.h|314 col 11| note: in instantiation of function template specialization 'testing::internal::ValuesInIteratorRangeGenerator<bool>::ValuesInIteratorRangeGenerator<const bool *>' requested here
||       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
||           ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googletest/include/gtest/gtest-param-test.h|319 col 10| note: in instantiation of function template specialization 'testing::ValuesIn<const bool *>' requested here
||   return ValuesIn(array, array + N);
||          ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h|102 col 12| note: in instantiation of function template specialization 'testing::ValuesIn<bool, 2>' requested here
||     return ValuesIn(array);
||            ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googletest/include/gtest/gtest-param-test.h|1221 col 10| note: in instantiation of function template specialization 'testing::internal::ValueArray2<bool, bool>::operator ParamGenerator<bool>' requested here
||   return Values(false, true);
||          ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|1402 col 2| error: use of undeclared identifier '__glibcxx_requires_string_len'
||         __glibcxx_requires_string_len(__s, __n);
||         ^
/usr/include/c++/7.3.1/sstream|194 col 12| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign' requested here
||         _M_string.assign(__s.data(), __s.size());
||                   ^
/usr/include/c++/7.3.1/sstream|789 col 22| note: in instantiation of member function 'std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str' requested here
||       { _M_stringbuf.str(__s); }
||                      ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googlemock/include/gmock/gmock-matchers.h|192 col 22| note: in instantiation of member function 'std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::str' requested here
||   void Clear() { ss_.str(""); }
||                      ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:44:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/string:52:
/usr/include/c++/7.3.1/bits/basic_string.h|2525 col 2| error: use of undeclared identifier '__glibcxx_requires_string'
||         __glibcxx_requires_string(__s);
||         ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googlemock/include/gmock/gmock-matchers.h|692 col 21| note: in instantiation of member function 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_of' requested here
||           type_name.find_first_of("<(") == string::npos);
||                     ^
|| In file included from ../temp/unittest/temp_test.cpp:8:
|| In file included from ../../googletest/googlemock/include/gmock/gmock.h:58:
|| In file included from ../../googletest/googlemock/include/gmock/gmock-actions.h:43:
|| In file included from /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/algorithm:61:
/usr/include/c++/7.3.1/bits/stl_algobase.h|1049 col 7| error: use of undeclared identifier '__glibcxx_requires_valid_range'
||       __glibcxx_requires_valid_range(__first1, __last1);
||       ^
/usr/include/c++/7.3.1/bits/stl_tree.h|1537 col 15| note: in instantiation of function template specialization 'std::equal<std::_Rb_tree_const_iterator<testing::Expectation>, std::_Rb_tree_const_iterator<testing::Expectation> >' requested here
||              && std::equal(__x.begin(), __x.end(), __y.begin());
||                      ^
/usr/include/c++/7.3.1/bits/stl_set.h|915 col 23| note: in instantiation of function template specialization 'std::operator==<testing::Expectation, testing::Expectation, std::_Identity<testing::Expectation>, testing::Expectation::Less, std::allocator<testing::Expectation> >' requested here
||     { return __x._M_t == __y._M_t; }
||                       ^
/mnt/c/Users/timofeysitnikov/HydroGuardFW/googletest/googlemock/include/gmock/gmock-spec-builders.h|594 col 26| note: in instantiation of function template specialization 'std::operator==<testing::Expectation, testing::Expectation::Less, std::allocator<testing::Expectation> >' requested here
||     return expectations_ == rhs.expectations_;
||                          ^
|| 15 errors generated.
|| ninja: build stopped: subcommand failed.
|| [Finished in 2 seconds with code 1]

В этом случае файл строится, если я не включаю gmock/gmock.h

0 ответов

Другие вопросы по тегам