Проблемы компиляции Qt 5.8 с std :: chrono - PullRequest
0 голосов
/ 26 марта 2019

Я занимаюсь разработкой приложения Qt в Ubuntu 17.04. Ранее я использовал последнюю версию Qt (Qt 5.12.2), но мне пришлось вернуться на несколько версий к Qt 5.8.

Мне удалось скомпилировать с использованием Qt 5.12 без проблем, но с Qt 5.8 я получаю следующие ошибки, связанные с std :: chrono:

In file included from /opt/Qt5.8.0/5.8/gcc_64/include/QtCore>/qmutex.h:48:0,
                 from /opt/Qt5.8.0/5.8/gcc_64/include/QtCore/QMutex:1,
                 ...

/usr/include/c++/6/chrono:221:6: error: macro "max" requires 2 arguments, but only 1 given
  max()
      ^
                                     ^
/usr/include/c++/6/chrono:225:6: error: macro "min" requires 2 arguments, but only 1 given
  min()
      ^
    ^~~~~~
/usr/include/c++/6/chrono:222:4: error: expected ‘}’ before ‘return’
/usr/include/c++/6/chrono:222:4: error: function definition does not declare parameters
/usr/include/c++/6/chrono:224:2: error: a storage class can only be specified for objects and functions
  static constexpr _Rep
  ^~~~~~
/usr/include/c++/6/chrono:224:19: error: expected ‘;’ before ‘_Rep’
  static constexpr _Rep
                   ^~~~
etc

Любые идеи о том, как решить эту проблему.

Это проблема версии g ++ или версии libstdc ++?

Вот моя версия g ++:

$ g++ --version
g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Если это так, то если будет полезен какой-либо совет по поводу очистки / удаления и установки apt-get.

...