インストール
Aspose.Email FOSS for C++ をインストール
Aspose.Email FOSS for C++ には外部依存関係がありません。C++17 コンパイラと CMake 3.14 以降が必要です。
ステップ 1: リポジトリをクローンする
git clone https://github.com/aspose-email-foss/Aspose.Email-FOSS-for-Cpp.gitステップ 2: CMake サブディレクトリとして追加
あなたのプロジェクトのCMakeLists.txtで:
cmake_minimum_required(VERSION 3.14)
project(my_project)
add_subdirectory(Aspose.Email-FOSS-for-Cpp)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE aspose_email_foss)ステップ3: ヘッダーを含める
#include "aspose/email/foss/msg/mapi_message.hpp"
#include "aspose/email/foss/cfb/cfb_reader.hpp"すべての公開ヘッダーは include/aspose/email/foss/ にあります。2つの主要サブシステムは次のとおりです:
| サブシステム | ヘッダーディレクトリ | キークラス |
|---|---|---|
| CFB | cfb/ | cfb_reader, cfb_writer, cfb_document, cfb_node |
| MSG | msg/ | mapi_message, msg_reader, msg_writer, msg_document |
ステップ 4: ビルドと検証
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build最小プログラムで検証:
#include <iostream>
#include "aspose/email/foss/msg/mapi_message.hpp"
int main()
{
auto message = aspose::email::foss::msg::mapi_message::create("Test", "Hello");
std::cout << message.subject() << '\n';
// Output: Test
}サポートされているプラットフォーム
| プラットフォーム | コンパイラ | 最低バージョン |
|---|---|---|
| Linux | GCC | 9+ |
| Linux | Clang | 10+ |
| macOS | Apple Clang | 12+ |
| Windows | MSVC | 2019 (16.0+) |
このライブラリは、プラットフォーム固有のコードやネイティブ依存関係なしに、すべてのプラットフォームで同一にビルドされます。