folly icon indicating copy to clipboard operation
folly copied to clipboard

Compilation error

Open wangyuyue opened this issue 1 year ago • 2 comments

  • tested os: Ubuntu 20.04 LTS
  • error information
FAILED: CMakeFiles/exception_wrapper_test.dir/folly/test/ExceptionWrapperTest.cpp.o 
/usr/bin/c++  -DBOOST_ALL_NO_LIB -DFOLLY_XLOG_STRIP_PREFIXES=\"/users/glacier/work/standalone-soc/folly:/tmp/fbcode_builder_getdeps-ZusersZglacierZworkZstandalone-socZfollyZbuildZfbcode_builder/build/folly\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/users/glacier/work/standalone-soc/folly -I. -I/usr/include/libdwarf -I/usr/include/libiberty -isystem /tmp/fbcode_builder_getdeps-ZusersZglacierZworkZstandalone-socZfollyZbuildZfbcode_builder/installed/fmt-klDXuAYrQX78cfS-G1yLNpqHLk7s3wawn2OmNfFjjRw/include -O2 -g -DNDEBUG   -g -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type -faligned-new -fopenmp -pthread -std=gnu++17 -MD -MT CMakeFiles/exception_wrapper_test.dir/folly/test/ExceptionWrapperTest.cpp.o -MF CMakeFiles/exception_wrapper_test.dir/folly/test/ExceptionWrapperTest.cpp.o.d -o CMakeFiles/exception_wrapper_test.dir/folly/test/ExceptionWrapperTest.cpp.o -c /users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp
In file included from /usr/include/gtest/gtest.h:375,
                 from /usr/include/gmock/internal/gmock-internal-utils.h:47,
                 from /usr/include/gmock/gmock-actions.h:51,
                 from /usr/include/gmock/gmock.h:59,
                 from /users/glacier/work/standalone-soc/folly/folly/portability/GMock.h:32,
                 from /users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp:23:
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp: In member function ‘virtual void ExceptionWrapper_throw_test_Test::TestBody()’:
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp:72:7: error: ‘ThrowsMessage’ was not declared in this scope
   72 |       ThrowsMessage<std::runtime_error>(StrEq("payload")));
      |       ^~~~~~~~~~~~~
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp:72:39: error: expected primary-expression before ‘>’ token
   72 |       ThrowsMessage<std::runtime_error>(StrEq("payload")));
      |                                       ^
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp: In member function ‘virtual void ExceptionWrapper_throw_with_nested_Test::TestBody()’:
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp:86:9: error: ‘ThrowsMessage’ was not declared in this scope
   86 |         ThrowsMessage<std::runtime_error>(StrEq("inner")));
      |         ^~~~~~~~~~~~~
/users/glacier/work/standalone-soc/folly/folly/test/ExceptionWrapperTest.cpp:86:41: error: expected primary-expression before ‘>’ token
   86 |         ThrowsMessage<std::runtime_error>(StrEq("inner")));
      |                                         ^
[26/404] Building CXX object CMakeFiles/Asy...olly/io/async/test/AsyncUDPSocketTest.cpp.o
FAILED: CMakeFiles/AsyncUDPSocketTest.dir/folly/io/async/test/AsyncUDPSocketTest.cpp.o 
/usr/bin/c++  -DBOOST_ALL_NO_LIB -DFOLLY_XLOG_STRIP_PREFIXES=\"/users/glacier/work/standalone-soc/folly:/tmp/fbcode_builder_getdeps-ZusersZglacierZworkZstandalone-socZfollyZbuildZfbcode_builder/build/folly\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/users/glacier/work/standalone-soc/folly -I. -I/usr/include/libdwarf -I/usr/include/libiberty -isystem /tmp/fbcode_builder_getdeps-ZusersZglacierZworkZstandalone-socZfollyZbuildZfbcode_builder/installed/fmt-klDXuAYrQX78cfS-G1yLNpqHLk7s3wawn2OmNfFjjRw/include -O2 -g -DNDEBUG   -g -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type -faligned-new -fopenmp -pthread -std=gnu++17 -MD -MT CMakeFiles/AsyncUDPSocketTest.dir/folly/io/async/test/AsyncUDPSocketTest.cpp.o -MF CMakeFiles/AsyncUDPSocketTest.dir/folly/io/async/test/AsyncUDPSocketTest.cpp.o.d -o CMakeFiles/AsyncUDPSocketTest.dir/folly/io/async/test/AsyncUDPSocketTest.cpp.o -c /users/glacier/work/standalone-soc/folly/folly/io/async/test/AsyncUDPSocketTest.cpp
/users/glacier/work/standalone-soc/folly/folly/io/async/test/AsyncUDPSocketTest.cpp: In member function ‘virtual void AsyncUDPSocketTest_TestWriteDynamicCmsg_Test::TestBody()’:
/users/glacier/work/standalone-soc/folly/folly/io/async/test/AsyncUDPSocketTest.cpp:1101:53: error: aggregate ‘testing::MockFunction<folly::Function<folly::Optional<std::map<folly::SocketOptionKey, int> >()> > mockAdditionalCmsgs’ has incomplete type and cannot be defined
 1101 |   MockFunction<AsyncUDPSocket::AdditionalCmsgsFunc> mockAdditionalCmsgs;
      |                                                     ^~~~~~~~~~~~~~~~~~~
/users/glacier/work/standalone-soc/folly/folly/io/async/test/AsyncUDPSocketTest.cpp: In member function ‘virtual void AsyncUDPSocketTest_TestWritemDynamicCmsg_Test::TestBody()’:
/users/glacier/work/standalone-soc/folly/folly/io/async/test/AsyncUDPSocketTest.cpp:1326:53: error: aggregate ‘testing::MockFunction<folly::Function<folly::Optional<std::map<folly::SocketOptionKey, int> >()> > mockAdditionalCmsgs’ has incomplete type and cannot be defined
 1326 |   MockFunction<AsyncUDPSocket::AdditionalCmsgsFunc> mockAdditionalCmsgs;

Thanks for opening source this library. I wish someone could help me find the error reason. Please feel free to ask me to provide more error information.

wangyuyue avatar Sep 26 '23 16:09 wangyuyue

Which version of google-test are you compiling with? It sounds like this may just be us requiring a newer version than you're compiling against.

Orvid avatar Oct 04 '23 22:10 Orvid

@Orvid I think this is fixed by c80861812ab36f1d8e2176b21aee5580a4549961

ahornby avatar Oct 08 '23 13:10 ahornby