「インストール - Qt5 Raspberry Pi」の版間の差分

ナビゲーションに移動 検索に移動
683行目: 683行目:
  </syntaxhighlight>
  </syntaxhighlight>
<br>
<br>
==== 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.x/qtbase/src/corelib/global/qglobal.hファイルを、以下に示すように編集する。<br>
vi qt-everywhere-src-5.15.x/qtbase/src/corelib/global/qglobal.h
<br>
<syntaxhighlight lang="c++">
// qt-everywhere-src-5.15.x/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>
==== デバッグエラー : No route to host ====
==== デバッグエラー : No route to host ====
デバッグ実行開始前に、以下に示すようなエラーが表示される場合がある。<br>
デバッグ実行開始前に、以下に示すようなエラーが表示される場合がある。<br>

案内メニュー