Can't compile with MinGW (Win8 x64)
WesleyCeraso opened this issue · 20 comments
Hi, I'm having trouble building GTest with MinGW, I used bisect to find the commit that broke the build:
a634042 is the first bad commit
commit a634042
Author: kosak kosak@google.com
Date: Mon Mar 24 21:58:25 2014 +0000
Implement threading support for gtest on Windows.
Also, stop using localtime(). Instead, use localtime_r() on most systems, localtime_s() on Windows.
The build step output:
$ cmake --build .
[ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.obj
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1704:3: error: 'AutoHandle' does not name a type
AutoHandle thread_;
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:43:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:626:3: error: 'AutoHandle' does not name a type
AutoHandle write_handle_;
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:628:3: error: 'AutoHandle' does not name a type
AutoHandle child_handle_;
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:633:3: error: 'AutoHandle' does not name a type
AutoHandle event_handle_;
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc: In member function 'virtual int testing::internal::WindowsDeathTest::Wait()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:645:36: error: 'child_handle_' was not declared in this scope
const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:645:57: error: 'event_handle_' was not declared in this scope
const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:659:3: error: 'write_handle_' was not declared in this scope
write_handle_.Reset();
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc: In member function 'virtual testing::internal::DeathTest::TestRole testing::internal::WindowsDeathTest::AssumeRole()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:709:3: error: 'write_handle_' was not declared in this scope
write_handle_.Reset(write_handle);
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:710:3: error: 'event_handle_' was not declared in this scope
event_handle_.Reset(::CreateEvent(
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:766:3: error: 'child_handle_' was not declared in this scope
child_handle_.Reset(process_info.hProcess);
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc: In function 'int testing::internal::GetStatusFileDescriptor(unsigned int, size_t, size_t)':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:1232:3: error: 'AutoHandle' was not declared in this scope
AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:1235:7: error: 'parent_process_handle' was not declared in this scope
if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:1251:26: error: 'parent_process_handle' was not declared in this scope
if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:1266:26: error: 'parent_process_handle' was not declared in this scope
if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In function 'void testing::internal::SleepMilliseconds(int)':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:139:6: error: redefinition of 'void testing::internal::SleepMilliseconds(int)'
void SleepMilliseconds(int n) {
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1377:13: note: 'void testing::internal::SleepMilliseconds(int)' previously defined here
inline void SleepMilliseconds(int n) {
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: At global scope:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:143:1: error: 'AutoHandle' does not name a type
AutoHandle::AutoHandle()
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:146:1: error: 'AutoHandle' does not name a type
AutoHandle::AutoHandle(Handle handle)
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:149:1: error: 'AutoHandle' does not name a type
AutoHandle::~AutoHandle() {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:153:1: error: 'AutoHandle' does not name a type
AutoHandle::Handle AutoHandle::Get() const {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:157:6: error: 'AutoHandle' has not been declared
void AutoHandle::Reset() {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In function 'void testing::internal::Reset()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:158:29: error: too many arguments to function 'void testing::internal::Reset()'
Reset(INVALID_HANDLE_VALUE);
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:157:6: note: declared here
void AutoHandle::Reset() {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: At global scope:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:161:6: error: 'AutoHandle' has not been declared
void AutoHandle::Reset(HANDLE handle) {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In function 'void testing::internal::Reset(HANDLE)':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:163:7: error: 'handle_' was not declared in this scope
if (handle_ != handle) {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:164:21: error: 'IsCloseable' was not declared in this scope
if (IsCloseable()) {
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:169:31: error: 'IsCloseable' was not declared in this scope
GTEST_CHECK_(!IsCloseable())
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1250:37: note: in definition of macro 'GTEST_CHECK_'
if (::testing::internal::IsTrue(condition))
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: At global scope:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:175:6: error: 'AutoHandle' has not been declared
bool AutoHandle::IsCloseable() const {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:175:32: error: non-member function 'bool testing::internal::IsCloseable()' cannot have cv-qualifier
bool AutoHandle::IsCloseable() const {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In function 'bool testing::internal::IsCloseable()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:178:10: error: 'handle_' was not declared in this scope
return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: At global scope:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:181:1: error: redefinition of 'testing::internal::Notification::Notification()'
Notification::Notification()
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1396:3: note: 'testing::internal::Notification::Notification()' previously defined here
Notification() : notified_(false) {
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:189:6: error: redefinition of 'void testing::internal::Notification::Notify()'
void Notification::Notify() {
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1405:8: note: 'void testing::internal::Notification::Notify()' previously defined here
void Notify() {
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:193:6: error: redefinition of 'void testing::internal::Notification::WaitForNotification()'
void Notification::WaitForNotification() {
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1413:8: note: 'void testing::internal::Notification::WaitForNotification()' previously defined here
void WaitForNotification() {
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h: In constructor 'testing::internal::Mutex::Mutex()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1616:13: warning: 'testing::internal::Mutex::type_' will be initialized after [-Wreorder]
MutexType type_;
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1612:16: warning: 'unsigned int testing::internal::Mutex::owner_thread_id_' [-Wreorder]
unsigned int owner_thread_id_;
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:198:1: warning: when initialized here [-Wreorder]
Mutex::Mutex()
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In constructor 'testing::internal::ThreadWithParamBase::ThreadWithParamBase(testing::internal::ThreadWithParamBase::Runnable, testing::internal::Notification)':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:337:9: error: class 'testing::internal::ThreadWithParamBase' does not have any field named 'thread_'
: thread_(ThreadWithParamSupport::CreateThread(runnable,
^
In file included from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/gtest.h:58,
from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:39:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In member function 'void testing::internal::ThreadWithParamBase::Join()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:346:38: error: 'thread_' was not declared in this scope
GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
^
C:/Users/wprudencio/gtest-1.7.0-hunter-11/include/gtest/internal/gtest-port.h:1250:37: note: in definition of macro 'GTEST_CHECK_'
if (::testing::internal::IsTrue(condition))
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:45:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc: In function 'bool testing::internal::IsCloseable()':
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-port.cc:179:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from C:\Users\wprudencio\gtest-1.7.0-hunter-11\src\gtest-all.cc:43:0:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc: At global scope:
C:/Users/wprudencio/gtest-1.7.0-hunter-11/src/gtest-death-test.cc:123:13: warning: 'testing::internal::g_in_fast_death_test_child' defined but not used [-Wunused-variable]
static bool g_in_fast_death_test_child = false;
^
CMakeFiles\gtest.dir\build.make:62: recipe for target 'CMakeFiles/gtest.dir/src/gtest-all.cc.obj' failed
mingw32-make.exe[2]: *** [CMakeFiles/gtest.dir/src/gtest-all.cc.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/gtest.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/gtest.dir/all] Error 2
makefile:126: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
Hi, I'm having the same problem, using the MinGW system supplied with Qt 5.5.
Submitted a PR with a patch fixing it on my system. Seems like perhaps the existing way of disabling pthreads when compiling with MinGW was somewhat lacking.
@andoks I'm using the same compiler. Was it working with other mingw versions?
AFAIK it has never worked for our team when using CMake, we are in the process of converting to using CMake (with hunter)
$ g++ --version
g++.exe (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ mingw32-make.exe --version
GNU Make 4.1
Built for i686-w64-mingw32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ qmake --version
QMake version 3.0
Using Qt version 5.5.0 in C:/tools/Qt/Qt5/5.5/mingw492_32/lib
$ cmake --version
cmake version 3.2.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Same problem compiling googletest with mingw for me with:
$ /usr/bin/i686-w64-mingw32-g++ --version
i686-w64-mingw32-g++ (GCC) 4.8.2
$ cmake --version
cmake version 2.8.12.2
David, your CMake must be newer than 3.0:
Notes about version of CMake
3.0.0 Minimum required
Buggy, see PR #198
Interface header-only libraries
Sub-option VERSION for command project
New MSVC generator names
3.1.0
Buggy, see issue #105
Retry download on hash mismatch (change)
New CMP0054 (best CMake policy! See this SO question)
3.2.0
New synchronization command file(LOCK ...) (change)
HUNTER_SKIP_LOCK
3.5.0 Minimum for iOS projects
New variable CMAKE_IOS_INSTALL_COMBINED (change)
iOS toolchain
@WesleyCeraso You're right, my workspace is out of date. :-(
I've got googletest 82b11b8 from January 21.
Turns out that I can work around the issue by configuring the project with -Dgoogle_disable_pthreads=ON
But point taken, we should look at updating versions of our tools.
I found a solution for this.
In those lines of gtest-port.h checking for the definition of GTEST_HAS_PTHREAD, you must include "and not GTEST_OS_WINDOWS_MINGW":
Line 607: #if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
Line 1444: #if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
Line 1461: #if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
Line 1559: #if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
Line 1921: # elif GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
I think it is a mistake because gtest creators do not use mingw.
With this changes you'll maintain threading support in windows.
@dvdjg Do you mind making a pull request to fix this bug? Thanks!
I cannot believe it has persisted for almost one year.
Google Test have several pull requests about that
https://github.com/google/googletest/pulls?utf8=%E2%9C%93&q=is%3Apr%20is%3Aopen%20mingw
PR #721 should fix this
Merged #721 I don't have a mingw to try it on, but it looks reasonable. Thanks for your patience.
For mingw32 - 5.3 compiler pointer casting errors appeared in gtest-port.cc, had to use reinterpret_cast in every usage of critical_section_ member in Mutex class
In file included from /tests/libs/gtest/googletest/src/gtest-all.cc:45:0:
/tests/libs/gtest/googletest/src/gtest-port.cc: In constructor 'testing::internal::Mutex::Mutex()':
/tests/libs/gtest/googletest/src/gtest-port.cc:242:45: error: cannot convert 'CRITICAL_SECTION* {aka RTL_CRITICAL_SECTION}' to 'GTEST_CRITICAL_SECTION_ {aka CRITICAL_SECTION*}' in initialization
critical_section(new CRITICAL_SECTION) {
^
/tests/libs/gtest/googletest/src/gtest-port.cc:243:48: error: cannot convert 'GTEST_CRITICAL_SECTION* {aka CRITICAL_SECTION}' to 'LPCRITICAL_SECTION {aka RTL_CRITICAL_SECTION}' for argument '1' to 'void
::InitializeCriticalSection(critical_section_);
I'm also having trouble building using CMake and MinGW32, building on a Linux host. Cross-compiling for Windows 32-bit. My versions are:
$ /home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake --version
cmake version 3.6.1
$ /usr/bin/i686-w64-mingw32-g++ --version
i686-w64-mingw32-g++ (GCC) 5.3.1 20160211
$ uname -a
Linux lenny 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
And here's my build output:
/home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake --build /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug --target runLDAPAuthenticator_Tests -- -j 4
/home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake -H/home/mellertson/Documents/Development_Projects/calatl_arealdap -B/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make -f CMakeFiles/Makefile2 runLDAPAuthenticator_Tests
make[1]: Entering directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
/home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake -H/home/mellertson/Documents/Development_Projects/calatl_arealdap -B/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake -E cmake_progress_start /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug/CMakeFiles 9
/usr/bin/make -f CMakeFiles/Makefile2 tests/CMakeFiles/runLDAPAuthenticator_Tests.dir/all
make[2]: Entering directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
/usr/bin/make -f tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/build.make tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/depend
make[3]: Entering directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
cd /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug && /home/mellertson/Downloads/clion-2016.2.2/bin/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /home/mellertson/Documents/Development_Projects/calatl_arealdap /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug/tests/gunit/googlemock/gtest /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug/tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/DependInfo.cmake --color=
Scanning dependencies of target gtest
make[3]: Leaving directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
/usr/bin/make -f tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/build.make tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/build
make[3]: Entering directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
[ 11%] Building CXX object tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
cd /home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug/tests/gunit/googlemock/gtest && /usr/bin/i686-w64-mingw32-g++ -I/home/mellertson/Documents/Development_Projects/calatl_arealdap/./includes -I/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest -I/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest -I/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include -std=gnu++11 -m32 -g -std=gnu++11 -m32 -Wall -Wshadow -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -o CMakeFiles/gtest.dir/src/gtest-all.cc.o -c /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1792:3: error: ‘AutoHandle’ does not name a type
AutoHandle thread_;
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:43:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:637:3: error: ‘AutoHandle’ does not name a type
AutoHandle write_handle_;
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:639:3: error: ‘AutoHandle’ does not name a type
AutoHandle child_handle_;
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:644:3: error: ‘AutoHandle’ does not name a type
AutoHandle event_handle_;
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc: In member function ‘virtual int testing::internal::WindowsDeathTest::Wait()’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:656:36: error: ‘child_handle_’ was not declared in this scope
const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:656:57: error: ‘event_handle_’ was not declared in this scope
const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:670:3: error: ‘write_handle_’ was not declared in this scope
write_handle_.Reset();
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc: In member function ‘virtual testing::internal::DeathTest::TestRole testing::internal::WindowsDeathTest::AssumeRole()’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:720:3: error: ‘write_handle_’ was not declared in this scope
write_handle_.Reset(write_handle);
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:721:3: error: ‘event_handle_’ was not declared in this scope
event_handle_.Reset(::CreateEvent(
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:777:3: error: ‘child_handle_’ was not declared in this scope
child_handle_.Reset(process_info.hProcess);
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc: In function ‘int testing::internal::GetStatusFileDescriptor(unsigned int, size_t, size_t)’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:1230:3: error: ‘AutoHandle’ was not declared in this scope
AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:1233:7: error: ‘parent_process_handle’ was not declared in this scope
if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:1249:26: error: ‘parent_process_handle’ was not declared in this scope
if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-death-test.cc:1264:26: error: ‘parent_process_handle’ was not declared in this scope
if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In function ‘void testing::internal::SleepMilliseconds(int)’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:179:6: error: redefinition of ‘void testing::internal::SleepMilliseconds(int)’
void SleepMilliseconds(int n) {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1458:13: note: ‘void testing::internal::SleepMilliseconds(int)’ previously defined here
inline void SleepMilliseconds(int n) {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: At global scope:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:183:1: error: ‘AutoHandle’ does not name a type
AutoHandle::AutoHandle()
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:186:1: error: ‘AutoHandle’ does not name a type
AutoHandle::AutoHandle(Handle handle)
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:189:1: error: ‘AutoHandle’ does not name a type
AutoHandle::~AutoHandle() {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:193:1: error: ‘AutoHandle’ does not name a type
AutoHandle::Handle AutoHandle::Get() const {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:197:6: error: ‘AutoHandle’ has not been declared
void AutoHandle::Reset() {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In function ‘void testing::internal::Reset()’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:198:29: error: too many arguments to function ‘void testing::internal::Reset()’
Reset(INVALID_HANDLE_VALUE);
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:197:6: note: declared here
void AutoHandle::Reset() {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: At global scope:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:201:6: error: ‘AutoHandle’ has not been declared
void AutoHandle::Reset(HANDLE handle) {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In function ‘void testing::internal::Reset(HANDLE)’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:203:7: error: ‘handle_’ was not declared in this scope
if (handle_ != handle) {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:204:21: error: ‘IsCloseable’ was not declared in this scope
if (IsCloseable()) {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:209:31: error: ‘IsCloseable’ was not declared in this scope
GTEST_CHECK_(!IsCloseable())
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1307:37: note: in definition of macro ‘GTEST_CHECK_’
if (::testing::internal::IsTrue(condition))
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: At global scope:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:215:6: error: ‘AutoHandle’ has not been declared
bool AutoHandle::IsCloseable() const {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:215:32: error: non-member function ‘bool testing::internal::IsCloseable()’ cannot have cv-qualifier
bool AutoHandle::IsCloseable() const {
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In function ‘bool testing::internal::IsCloseable()’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:218:10: error: ‘handle_’ was not declared in this scope
return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: At global scope:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:221:1: error: redefinition of ‘testing::internal::Notification::Notification()’
Notification::Notification()
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1480:3: note: ‘testing::internal::Notification::Notification()’ previously defined here
Notification() : notified_(false) {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:229:6: error: redefinition of ‘void testing::internal::Notification::Notify()’
void Notification::Notify() {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1489:8: note: ‘void testing::internal::Notification::Notify()’ previously defined here
void Notify() {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:233:6: error: redefinition of ‘void testing::internal::Notification::WaitForNotification()’
void Notification::WaitForNotification() {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1497:8: note: ‘void testing::internal::Notification::WaitForNotification()’ previously defined here
void WaitForNotification() {
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:45:0:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In constructor ‘testing::internal::ThreadWithParamBase::ThreadWithParamBase(testing::internal::ThreadWithParamBase::Runnable_, testing::internal::Notification_)’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:377:9: error: class ‘testing::internal::ThreadWithParamBase’ does not have any field named ‘thread_’
: thread_(ThreadWithParamSupport::CreateThread(runnable,
^
In file included from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-internal.h:40:0,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/gtest.h:58,
from /home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-all.cc:39:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc: In member function ‘void testing::internal::ThreadWithParamBase::Join()’:
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/src/gtest-port.cc:386:38: error: ‘thread_’ was not declared in this scope
GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
^
/home/mellertson/Documents/Development_Projects/calatl_arealdap/tests/gunit/googletest/include/gtest/internal/gtest-port.h:1307:37: note: in definition of macro ‘GTEST_CHECK_’
if (::testing::internal::IsTrue(condition))
^
tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/build.make:65: recipe for target 'tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o' failed
make[3]: *** [tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[3]: Leaving directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
CMakeFiles/Makefile2:376: recipe for target 'tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/all' failed
make[2]: *** [tests/gunit/googlemock/gtest/CMakeFiles/gtest.dir/all] Error 2
make[2]: Leaving directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
CMakeFiles/Makefile2:142: recipe for target 'tests/CMakeFiles/runLDAPAuthenticator_Tests.dir/rule' failed
make[1]: *** [tests/CMakeFiles/runLDAPAuthenticator_Tests.dir/rule] Error 2
make[1]: Leaving directory '/home/mellertson/.CLion2016.2/system/cmake/generated/calatl_arealdap-66314019/66314019/Debug'
Makefile:167: recipe for target 'runLDAPAuthenticator_Tests' failed
make: *** [runLDAPAuthenticator_Tests] Error 2
Hi @mellertson: How did you initially configure with cmake?
#1051
-Dgtest_disable_pthreads=ON
fix my problem.