Skip to content

Instantly share code, notes, and snippets.

@acgetchell
Created September 9, 2014 10:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acgetchell/004242400a17d8bd72fc to your computer and use it in GitHub Desktop.
Save acgetchell/004242400a17d8bd72fc to your computer and use it in GitHub Desktop.
CMake tutorial gmock 1.7 errors
┌─[getchell][Hapkido][±][master ✓][~/cmake-tutorial]
└─▪ mkdir build
┌─[getchell][Hapkido][±][master ✓][~/cmake-tutorial]
└─▪ cd build
┌─[getchell][Hapkido][±][master ✓][~/cmake-tutorial/build]
└─▪ cmake -G "Unix Makefiles" ..
-- The C compiler identification is AppleClang 6.0.0.6000051
-- The CXX compiler identification is AppleClang 6.0.0.6000051
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/getchell/cmake-tutorial/build
┌─[getchell][Hapkido][±][master ✓][~/cmake-tutorial/build]
└─▪ make
Scanning dependencies of target toDoCore
[ 10%] Building CXX object ToDoCore/CMakeFiles/toDoCore.dir/ToDo.cpp.o
Linking CXX static library libtoDoCore.a
[ 10%] Built target toDoCore
Scanning dependencies of target toDo
[ 20%] Building CXX object CMakeFiles/toDo.dir/main.cpp.o
Linking CXX executable toDo
[ 20%] Built target toDo
Scanning dependencies of target gmock_main
[ 30%] Building CXX object gmock/CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o
In file included from /Users/getchell/gmock-1.7.0/gtest/src/gtest-all.cc:42:
/Users/getchell/gmock-1.7.0/gtest/src/gtest.cc:370:12: error: missing field
'owner_' initializer [-Werror,-Wmissing-field-initializers]
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
^
/Users/getchell/gmock-1.7.0/gtest/include/gtest/internal/gtest-port.h:1390:79: note:
expanded from macro 'GTEST_DEFINE_STATIC_MUTEX_'
::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
^
1 error generated.
make[2]: *** [gmock/CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o] Error 1
make[1]: *** [gmock/CMakeFiles/gmock_main.dir/all] Error 2
make: *** [all] Error 2
@binshuohu
Copy link

This certainly solves my problem, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment