I am developing a Qt application on Ubuntu 17.04. I was previously using the latest Qt version (Qt 5.12.2) but I had to go back a few versions to Qt 5.8.
I was able to compile with using Qt 5.12 with no issues but with Qt 5.8 I get the following errors all related to 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
Any ideas on how to resolve this issue.
Is this a g++ version or a libstdc++ version issue?
Here is my g++ version:
$ 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.
If so, if any advice on what to purge/remove and apt-get install would be helpful.