2016-09-17 6 views
0

上のMinGWでGoogleのテストをコンパイルすることはできません私はthis postからの指示に従って、Windows上でのMinGWでGoogleのテストフレームワークをコンパイルしようとしましたが、makeを実行するとき、私はエラーを得た:は、Windows

[ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.obj 
In file included from d:/downloads/googletest-master/googletest/src/gtest-all.cc:45:0: 
D:/downloads/googletest-master/googletest/src/gtest-port.cc: In static member function 'static void testing::internal::ThreadLocalRegistryImpl::StartWatcherThreadFor(DWORD)': 
D:/downloads/googletest-master/googletest/src/gtest-port.cc:495:21: error: '::OpenThread' has not been declared 
    HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION, 
        ^
make[2]: *** [CMakeFiles/gtest.dir/src/gtest-all.cc.obj] Error 1 
make[1]: *** [CMakeFiles/gtest.dir/all] Error 2 
make: *** [all] Error 2 

助けてください。

cmake -G "MSYS Makefiles" --with-pthreads=no 

をしかし得た:私が試した答えを

CMake Error: The source directory "D:/downloads/googletest-master/googletest/--with-pthreads=no" does not exist. 
Specify --help for usage, or press the help button on the CMake GUI. 

感謝を。

答えて

0
cmake -G "MSYS Makefiles" --with-pthreads=no 

私は考えていません--with-pthreads=no有効なcmakeオプションです。 CMakeはそれをソースディレクトリとして解釈しようとします。そのオプションを削除します。私はGoogleのテストは、とにかく、なぜOpenThreadは、pthreadsに依存するため、宣言されていないpthreadsが必要だと思います。

MSYSシェルを使用していない場合は、cmake用の "MinGW Makefile"ジェネレータを使用してみてください。

cmake -G "MinGW Makefiles" 

次に、makeを実行します。