|
|
| 1,581行目: |
1,581行目: |
|
| |
|
| ==== Qtのビルド ==== | | ==== Qtのビルド ==== |
| ===== GCC 11以降を使用する場合 =====
| |
| GCC 11以降のツールチェーンを使用する場合、Qt 5.15のビルド時において、以下に示すエラーが発生する。<br>
| |
| error: 'numeric_limits' is not a member of 'std' static_cast<quint16>(numbers.size()) : std::numeric_limits<quint16>::max();
| |
|
| |
| error: expected primary-expression before '>' token static_cast<quint16>(numbers.size()) : std::numeric_limits<quint16>::max();
| |
|
| |
| error: '::max' has not been declared; did you mean 'std::max'? static_cast<quint16>(numbers.size()) : std::numeric_limits<quint16>::max();
| |
| <br>
| |
| これは、std::limitsが削除されて、limits.hファイルに移行されたからである。<br>
| |
| もし、GCC 11以降を使用してQt 5.15をビルドする場合は、qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qglobal.hファイルを、以下に示すように編集する。<br>
| |
| vi qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qglobal.h
| |
| <br>
| |
| <syntaxhighlight lang="c++">
| |
| // qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qglobal.hファイル
| |
| // 45〜48行目あたり
| |
|
| |
| // 編集前
| |
| #ifdef __cplusplus
| |
| # include <type_traits>
| |
| # include <cstddef>
| |
| # include <utility>
| |
| #endif
| |
|
| |
| // 編集後
| |
| #ifdef __cplusplus
| |
| # include <type_traits>
| |
| # include <cstddef>
| |
| # include <utility>
| |
| #include <limits>
| |
| #endif
| |
| </syntaxhighlight>
| |
| <br>
| |
| ===== Qtのビルド ===== | | ===== Qtのビルド ===== |
| Qtをビルドするため、ビルド用のディレクトリを作成する。<br> | | Qtをビルドするため、ビルド用のディレクトリを作成する。<br> |