🔊

Tiny Ember+を(ビルドして)入手する

に公開

はじめに

Tiny Ember+(Emberビューワとの相互接続検証用の試験用Emberプロバイダ)を入手し動作確認をしたかったのですが、ビルドのための環境構築で詰まったので記事としてまとめておきます。

https://github.com/Lawo/ember-plus

This tutorial will show working code that can be copy-pasted into a console application, which can then be used to connect to Tiny Ember+. Tiny Ember+ is a part of the Ember+ SDK, which can be downloaded from the Ember+ Releases Page.

同じくLAWOが公開・管理している別のリポジトリ(ember-plus-sharp)のドキュメントには、ember-plusリポジトリのリリースページよりツールがダウンロードできると記載がありますが、Tiny Ember+がダウンロードできるリリースバージョンは2015年(v1.6.2)が最後のようです。
直近10年のコミットでTiny Ember+は本当に一度も変更されていないのか調べるのが面倒だったのと、ゆくゆくはビルド環境も必要なため、リポジトリのソースコードからTiny Ember+をビルドしてツールを入手することにしました。

ゴール

  • ember-plus関連ライブラリのビルド環境を構築する
  • Tiny Ember+をビルドして入手する

対象読者

  • C++の基本的な開発環境が未構築な人

動作確認環境

  • Windowsの仕様
    • エディション Windows 11 Home
    • バージョン 24H2
    • インストール日 ‎2025/‎02/‎24
    • OS ビルド 26100.6584
    • エクスペリエンス Windows 機能エクスペリエンス パック 1000.26100.234.0
  • VSCodeの仕様
    • Version: 1.105.0 (user setup)
    • OS: Windows_NT x64 10.0.26100
  • ツールの仕様
    • CMake version 4.1.2
    • QMake version 3.1
    • Qt version 5.15.17

CMakeのインストール

以下のリリースページからcmake-4.1.2-windows-x86_64.msiなど、環境に合うインストーラーをダウンロードする。
https://github.com/Kitware/CMake/releases/

デフォルト設定のままインストールを進めればPATHにCMakeのPATHが追加されるので、エディタを開き直して以下のコマンドを実行でインストールされ、PATHが通っていることが確認できる。

cmake -version     
cmake version 4.1.2

Qt5のインストール

以下のページを参考に、Microsoft.VisualStudio.2022.BuildToolsのインストール→vcpkgのインストール→Qt5のインストールを実施する。
https://www.kkaneko.jp/tools/win/qt5.html

不安になるぐらい時間がかかるが、とにかく待つ。(私の環境では以下のようにインストールに25分かかりました)

Completed submission of qt5[activeqt,core,declarative,essentials,imageformats,multimedia,networkauth,quickcontrols,quickcontrols2,svg,tools,translations,websockets]:x64-windows@5.15.17 to 1 binary cache(s) in 22.3 ms (2/2)
All requested installations completed successfully in: 25 min

参考サイトの実施手順に従えばvcpkg, qt5のPATHはコマンド経由で登録されるが、手動で実施したい場合はそれぞれ以下のパスを環境変数に追加しておく。

C:\vcpkg\packages\qt5-base_x64-windows\tools\qt5\bin
C:\vcpkg

エディタを開き直し、以下のコマンドを実行でインストールされ、PATHが通っていることが確認できる。

qmake -v
QMake version 3.1
Using Qt version 5.15.17 in C:/vcpkg/packages/qt5-base_x64-windows/lib

ビルド

リポジトリ直下で以下のコマンドを実行する。

cmake --build build --target TinyEmberPlus --config Release

...だけだと、以下のようなエラーが出てビルドが通らない!

C:\Users\issan\Playground\emberplus\ember-plus\libember\Headers\ember\ber\traits\../detail/M 
ultiByte.hpp(102,41): error C3861: 'runtime_error': 識別子が見つかりませんでした [C:\Users\issan\Playgroun
d\emberplus\ember-plus\build\libember\ember-static.vcxproj]

Tag.hpp, MultiByte.hppにそれぞれ#include <stdexcept>を追加してビルドし直すことで解決できた。

https://github.com/Lawo/ember-plus/pull/127
PRも出してみました。

参考

https://stackoverflow.com/questions/60609436/visual-studio-2019-stl-include-errors
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3861
https://github.com/Lawo/ember-plus/issues/123
https://github.com/microsoft/vcpkg
https://lawo.github.io/ember-plus-sharp/html/5b9afbff-f6fc-4870-892f-6d6b76f85c67.htm
本稿は以下のスクラップを見やすく記事化したものです。https://zenn.dev/tesseract/scraps/00184547ffe4a0

Discussion