Compilation and Linking errors when building googletest with PlatformIO #3697
Unanswered
VineetaNarkhede-eaton
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
1. I have downloaded the latest GoogleTest source code manually and placed it at a known location in my project.
I am getting linking errors, some of them are given below:
testing::internal::ColoredPrintf(testing::internal::(anonymous namespace)::GTestColor, char const*, ...)': gtest-all.cc:(.text+0xa508): undefined reference to
__sync_synchronize'testing::internal::FilePath::CreateFolder() const':gtest-all.cc:(.text+0x1af3c): undefined reference to
mkdir'_stat_r':statr.c:(.text._stat_r+0xe): undefined reference to
_stat'How to fix there errors?
GoogleTest cmake files says cmake_minimum_required(VERSION 3.5) and cmake tool I am having is 3.16.4, will it cause any issue?
2. I have Added "set(CMAKE_CXX_COMPILE_FEATURES cxx_std_11)" and "set(CMAKE_CXX_STANDARD 11)" in main CMakeLists.txt
3. Turned on gtest_disable_pthreads to remove pthread related errors and std namespace undefined errors, option(gtest_disable_pthreads "Disable uses of pthreads in gtest." ON).
Turned on CMAKE_CXX_EXTENSIONS to remove errors like 'fileno' was not declared in scope, set(CMAKE_CXX_EXTENSIONS ON).
Will these changes impact gtest functionality or disable any important features?
Beta Was this translation helpful? Give feedback.
All reactions