> For the complete documentation index, see [llms.txt](https://mwx.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mwx.twelite.info/v0.1.9/install_n_build/install_sdk.md).

# TWELITE SDK のインストール

{% hint style="success" %}
下の記述は TWELITE STAGE SDK MWSDK2020\_12 に対応します。
{% endhint %}

{% hint style="info" %}
TWELITE STAGE SDK をダウンロードした場合は、配布zipアーカイブを、**日本語や空白文字が含まれない**ディレクトリに展開します。

TWELITE STAGE については以下もご覧ください。

* [インストール・使用方法](https://mono-wireless.com/jp/products/stage)
* [インストール補足情報](https://stage.twelite.info/)
  {% endhint %}

### 3. 環境変数の設定

{% hint style="warning" %}
TWELITE STAGE アプリを用いる場合は、**環境変数の設定は不要**です。コマンドラインでビルドを行う場合は設定してください。
{% endhint %}

`MWSDK_ROOT`, `MWSDK_ROOT_WINNAME`(Windows10のみ) の設定が必要です。

{% tabs %}
{% tab title="Windows10" %}
ここでは展開後のディレクトリ名を `C:\MWSTAGE` とします。別のディレクトリにインストールした場合は、読み替えてください。

`C:\MWSTAGE\Tools\SET_ENV.CMD` を実行してください。以下の環境変数を設定します。

* `MWSDK_ROOT`
* `MWSDK_ROOT_WINNAME`

例えば以下のような設定になります。

```
MWSDK_ROOT=C:/MWSTAGE/MWSDK/
MW_ROOT_WINNAME=C:\MWSTAGE\MWSDK\
```

{% hint style="warning" %}
インストールしたPC上からTWELITE STAGE SDKをアンインストールするには以下を行ってください。

* `UNSET_ENV.cmd`を実行してください。環境変数の設定を解除します。
* MWSTAGEディレクトリを削除してください。
  {% endhint %}
  {% endtab %}

{% tab title="Linux" %}
開発環境やシェルに `MWX_ROOT`環境変数を反映されるように設定してください。

方法はいくつかありますが、ホームディレクトリの`.profile`（ファイルがなければ新しく作成してください）に以下の設定を追加します。この設定でVSCodeのビルドまで可能です。

`MWSDK_ROOT=/foo/bar/MWSTAGE/MWSDK/`\
`export MWSDK_ROOT`

エディタを使用せずに追加するには以下のようにコマンド入力します。`$`はプロンプトで環境によって表示が違います。`/foo/bar/MSWSDK`の部分はインストールしたディレクトリに応じて書き換えてください。

```bash
$ cd $HOME
$ echo MWSDK_ROOT=/foo/bar/MWSTAGE/MWSDK>>.profile
$ echo export MWSDK_ROOT>>.profile
```

{% endtab %}

{% tab title="macOS" %}
開発環境やシェルに `MWX_ROOT`環境変数を反映されるように設定してください。

方法はいくつかありますが、ホームディレクトリの`.profile`（ファイルがなければ新しく作成してください）に以下の設定を追加します。この設定でVSCodeのビルドまで可能です。

`MWSDK_ROOT=/foo/bar/MWSTAGE/MWSDK/`\
`export MWSDK_ROOT`

エディタを使用せずに追加するには以下のようにコマンド入力します。`$`はプロンプトで環境によって表示が違います。`/foo/bar/MSWSDK`の部分はインストールしたディレクトリに応じて書き換えてください。

```bash
$ cd $HOME
$ echo MWSDK_ROOT=/foo/bar/MWSTAGE/MWSDK>>.profile
$ echo export MWSDK_ROOT>>.profile
```

{% hint style="info" %}
環境全体に`MWSDK_ROOT`を適用にするにはLaunchDを用います。

VS Codeの一部の設定で環境変数を参照していますが、ビルドには必須ではありません。
{% endhint %}
{% endtab %}
{% endtabs %}

### 4. ライブラリの修正の適用

SDKに収録された時点から、ライブラリソースコードに修正がある場合があります。[改版履歴](/v0.1.9/revisions.md)を参照の上、必要に応じでライブラリソースコードを差し替えてください。

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mwx.twelite.info/v0.1.9/install_n_build/install_sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
