xuyongli73 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compilation errors on MinGW #484

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Google Test fails to compile on the default installation of MinGW 
(http://www.mingw.org/):

> cmake -G "MinGW Makefiles"
> mingw32-make
...

C:/googletest/src/gtest-port.cc:202:45: error: cannot convert 
'CRITICAL_SECTION* {aka _CRITICAL_SECTION*}' to '_RTL_CRITICAL_SECTION*' in 
initialization
       critical_section_(new CRITICAL_SECTION) {
                                             ^
C:/googletest/src/gtest-port.cc:203:48: error: cannot convert 
'_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for 
argument '1' to 'void InitializeCriticalSection(LPCRITICAL_SECTION)'
   ::InitializeCriticalSection(critical_section_);
                                                ^
C:/googletest/src/gtest-port.cc: In destructor 
'testing::internal::Mutex::~Mutex()':
C:/googletest/src/gtest-port.cc:213:46: error: cannot convert 
'_RTL_CRITICAL_SECTION*' to 'PCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for 
argument '1' to 'void DeleteCriticalSection(PCRITICAL_SECTION)'
     ::DeleteCriticalSection(critical_section_);
                                              ^
C:/googletest/src/gtest-port.cc: In member function 'void 
testing::internal::Mutex::Lock()':
C:/googletest/src/gtest-port.cc:221:43: error: cannot convert 
'_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for 
argument '1' to 'void EnterCriticalSection(LPCRITICAL_SECTION)'
   ::EnterCriticalSection(critical_section_);
                                           ^
C:/googletest/src/gtest-port.cc: In member function 'void 
testing::internal::Mutex::Unlock()':
C:/googletest/src/gtest-port.cc:231:43: error: cannot convert 
'_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for 
argument '1' to 'void LeaveCriticalSection(LPCRITICAL_SECTION)'
   ::LeaveCriticalSection(critical_section_);
                                           ^
C:/googletest/src/gtest-port.cc: In member function 'void 
testing::internal::Mutex::ThreadSafeLazyInit()':
C:/googletest/src/gtest-port.cc:252:27: error: cannot convert 
'CRITICAL_SECTION* {aka _CRITICAL_SECTION*}' to '_RTL_CRITICAL_SECTION*' in 
assignment
         critical_section_ = new CRITICAL_SECTION;
                           ^
C:/googletest/src/gtest-port.cc:253:54: error: cannot convert 
'_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for 
argument '1' to 'void InitializeCriticalSection(LPCRITICAL_SECTION)'
         ::InitializeCriticalSection(critical_section_);
                                                      ^
C:/googletest/src/gtest-port.cc: In static member function 'static void 
testing::internal::ThreadLocalRegistryImpl::StartWatcherThreadFor(DWORD)':
C:/googletest/src/gtest-port.cc:455:21: error: '::OpenThread' has not been 
declared
     HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
                     ^

Original issue reported on code.google.com by victor.z...@gmail.com on 19 Mar 2015 at 1:52