I get one C++ source code and the project structure as follow:
|-+ ACode
|-+ src //include code
|-+ include //include .h file
|-+ test
|-+ CMakeLists.txt
.... //similar to the ACode
|-+ build
|-+ doc
|-+ ThirdParty
|-+ googletest-release-1.8.0
|-+ googlemock
|-+ googletest
|-+ CMakeLists.txt
|-+ MultipartParser
|-+ rapidjson
|-+ CMakeLists.txt
|-+ googletest.cmake
|-+ tests
|-+ CMakeLists.txt
I used cmake -> make can build success and can execute success on linux platform.
Now i want to use arm-linux-gcc
cross compile it.
Get the error message after modifying the project CMakeLists.txt file. CMakeLists.txt file add follow content:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "/../../toolschain/4.4.3/bin/arm-linux-gcc")
SET(CMAKE_CXX_COMPILER "/../../toolschain/4.4.3/bin/arm-linux-g++")
Get error message while used make command:
Scanning dependencies of target gmock_main [ 1%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/__/googletest/src/gtest-all.cc.o [ 2%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o In file included from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock.h:58, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/src/gmock-all.cc:40: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-actions.h: In static member function 'static Result testing::internal::ReturnNullAction::Perform(const ArgumentTuple&)': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-actions.h:631: error: 'nullptr' was not declared in this scope In file included from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:75, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h:43, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock.h:61, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/src/gmock-all.cc:40: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In member function 'bool testing::internal::IsNullMatcher::MatchAndExplain(const Pointer&, testing::MatchResultListener*) const': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:983: error: 'nullptr' was not declared in this scope /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In member function 'bool testing::internal::NotNullMatcher::MatchAndExplain(const Pointer&, testing::MatchResultListener*) const': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1003: error: 'nullptr' was not declared in this scope /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: At global scope: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1560: sorry, unimplemented: cannot expand 'Tail ...' into a fixed-length argument list /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1561: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1561: error: 'ListType' in class 'int' does not name a type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1561: error: template argument 2 is invalid /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1561: error: expected '::' before 'ListType' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In static member function 'static int testing::internal::MatcherList::BuildList(const Head&, const Tail& ...)': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1568: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1568: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1568: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1568: error: 'BuildList' is not a member of 'int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In static member function 'static testing::Matcher testing::internal::MatcherList::CreateMatcher(const int&)': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1578: error: request for member 'first' in 'matchers', which is of non-class type 'const int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'CreateMatcher' is not a member of 'int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1580: error: request for member 'second' in 'matchers', which is of non-class type 'const int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1577: error: expected primary-expression before '(' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1578: error: request for member 'first' in 'matchers', which is of non-class type 'const int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: 'CreateMatcher' is not a member of 'int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: expected primary-expression before ',' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1579: error: missing template arguments before '>' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1580: error: request for member 'second' in 'matchers', which is of non-class type 'const int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: At global scope: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1623: sorry, unimplemented: cannot expand 'Args ...' into a fixed-length argument list /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1625: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1625: error: 'ListType' in class 'int' does not name a type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In constructor 'testing::internal::VariadicMatcher::VariadicMatcher(const Args& ...)': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1611: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1611: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1611: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1611: error: 'BuildList' is not a member of 'int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: In member function 'testing::internal::VariadicMatcher::operator testing::Matcher() const': /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'int' is not a class type /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: 'CreateMatcher' is not a member of 'int' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: expected primary-expression before ',' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1618: error: missing template arguments before '>' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h: At global scope: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1631: error: expected unqualified-id before 'using' /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:1725: error: expected unqualified-id before 'using' In file included from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:75, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h:43, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock.h:61, from /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/src/gmock-all.cc:40: /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:4363: error: expected initializer before '<' token /../../Linux+C/Temp/20170414/alexa-client-sdk-master/ThirdParty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:4368: error: expected initializer before '<' token make[2]: * [ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o] Error 1 make[1]: * [ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/all] Error 2 make: *** [all] Error 2
Can anyone help me how to modify the CMakeLists.txt file? Or did i miss something?