0

cmake を使用して Windows で libaws (http://sourceforge.net/projects/libaws/) ライブラリをコンパイルしようとしています。openssl、libxml、libcurl を含め、このコマンド ラインを使用しています。

C:\libaws>cmake -G "Visual Studio 10" -DCURL_LIBRARY="C:\tools\curl-7.28.1\lib" -DCURL_INCLUDE_DIR="C:\tools\curl-7.28.1\include" -DLIBXML2_LIBRARIES="C:\tools\libxml22.7.8.win32\lib" -DLIBXML2_INCLUDE_DIR="C:\tools\libxml2-2.7.8.win32\include" -DPTHREAD_INCLUDE_DIR="C:\tools\pthread\include"  ..\tools\libaws-0.9.2
--    

次のエラーがスローされます。

-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CURL: C:/tools/curl-7.28.1/lib (found version "7.28.1")
-- Found OpenSSL: optimized;C:/openssl/lib/ssleay32.lib;debug;C:/openssl/lib/ssleay32.lib;optimized;C:/openssl/lib/libeay32.lib;debug;C:/openssl/lib/libeay32.lib (found version "1.0.1c")
-- Found LibXml2: C:/tools/libxml2-2.7.8.win32/lib (found version "2.7.8")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found.

CMakeLists.txt:78 の CMake エラー (メッセージ): pthread 開発ヘッダーが見つかりませんでした

ptherad.h、semaphore.h などを C:\tools\pthread\include に含め、コマンド ライン フラグとして指定しました: -DPTHREAD_INCLUDE_DIR="C:\tools\pthread\include"。私のCMakeLists.txtに、追加しました

INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIR})

何か案は?

4

1 に答える 1

3

Visual Studio には "pthread" の実装が付属していません。MinGW などの別のコンパイラを使用する必要があると思います。

@ jens-a-kochは正しいです:私の答えは受け入れられません! 削除しますので「同意しない」でお願いします。

あなたの CMake find モジュールは PTHREAD_INCLUDE_DIR 定義を使用していない可能性があると思います (@ drescherjm が言ったことと同様)。

于 2012-11-21T03:02:23.233 に答える