ActiveMQ ソースの README.txt の指示に従って、コマンド ラインから APR をビルドできました。
6.2.1 APR ライブラリ。
APR は、Apache Software Foundation からのみソース形式で提供されます。以下から最新のリリースをダウンロードして、ソースからライブラリをビルドする必要があります。
http://apr.apache.org/
この記事の執筆時点では、最新バージョンは v1.5.2 であり、そのビルド サポート ファイルが Visual Studio 2010 ツールで動作するため、推奨されています。
APR は、提供されている Make ファイルを使用してコマンド ラインからビルドされます。ライブラリをビルドするときは、目的のアーキテクチャ ビルド (x64 または win32) を生成するための適切な環境にいることを確認する必要があります。Visual Studio のスタート メニューの場所にあるショートカットを使用して、正しいコマンド ラインを開くことができます (例: Visual Studio 2010 / Visual Studio Tools / Visual Studio x64 win 64 Command Prompt
適切なコマンド プロンプトが表示されたら、APR ソース コードが配置されているディレクトリ (例: C:\APR) に移動し、ライブラリのビルドを実行して目的の ARCH ビルドを生成します。
適切な配布ディレクトリにインストールされる 32 ビット ライブラリの場合は、次を実行します。
nmake -f Makefile.win ARCH="Win32 Release" PREFIX=C:\dist\APR\x64 buildall install clean
ライブラリの 64 ビット ビルドの場合は、コマンドを使用します。
nmake -f Makefile.win ARCH="x64 Release" PREFIX=C:\dist\APR\x64 buildall install clean
やった:
[スタート] メニュー > [すべてのプログラム] > [Visual Studio 2017] > [Visual Studio ツール]に移動し、開発者コマンド プロンプト
を起動します。そこから APR ソースの場所に移動し、適切なコマンドを実行します。64ビットのWindows 7で実行しましたnmake -f Makefile.win ARCH="Win32 Release" PREFIX=C:\dist\APR\x64 buildall install clean
より一般的な:
[スタート] メニュー > [すべてのプログラム] > [Visual Studio 2017] > [Visual Studio ツール] > [VC]に移動し、ビルド対象のアーキテクチャのコマンド プロンプトを起動します。次にnmake -f Makefile.win ARCH="x64 Release" PREFIX=C:\dist\APR\x64 buildall install clean
、x64 アーキテクチャ用にビルドする場合に上記の手順を続けます。
これでAPRのビルドに成功し、入れましたC:\dist\APR\x64
次に、Visual StudioC:\dist\APR\x64\includes
で、プロジェクト プロパティの追加インクルードにリンクされていることを確認します。
- プロジェクトを右クリックし、[プロパティ] を選択します
- 構成プロパティの展開
- C/C++ を展開する
- 一般を選択
- 追加のインクルード ディレクトリを編集し、C:\path\to\APR\arch\include を追加します
- 変更を適用
この時点でビルドすると、次のエラーが発生します (解決策については以下を参照してください)。
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(53): error C2039: 'auto_ptr': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\sstream(13): note: see declaration of 'std'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(53): error C2143: syntax error: missing ';' before '<'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(53): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(53): error C2238: unexpected token(s) preceding ';'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(55): error C2614: 'decaf::internal::security::SRNGData': illegal member initialization: 'random' is not a base or member
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(74): error C2039: 'random': is not a member of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(45): note: see declaration of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(74): error C2228: left of '.reset' must have class/struct/union
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(96): error C2039: 'random': is not a member of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(45): note: see declaration of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(96): error C2228: left of '.get' must have class/struct/union
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(99): error C2039: 'random': is not a member of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(45): note: see declaration of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(99): error C2227: left of '->setSeed' must point to class/struct/union/generic type
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(117): error C2039: 'random': is not a member of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(45): note: see declaration of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(117): error C2228: left of '.get' must have class/struct/union
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(140): error C2039: 'random': is not a member of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(45): note: see declaration of 'decaf::internal::security::SRNGData'
1>..\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp(140): error C2227: left of '->nextBytes' must point to class/struct/union/generic type
エラーを解決するには、ファイルの先頭にactivemq-cpp-library-3.9.4\src\main\decaf\internal\security\windows\SecureRandomImpl.cpp
追加して編集します。#include <memory>
上記のインクルードを追加した後に再構築すると、ActiveMQ の構築が成功します。
出力先:activemq-cpp-library-3.9.4\vs2010-build\\Win32\Release\libactivemq-cpp.lib