[Interest] compilation error in qdatetime

Thiago Macieira thiago.macieira at intel.com
Fri Nov 8 17:40:20 CET 2013


On sexta-feira, 8 de novembro de 2013 16:36:14, Graham Labdon wrote:
> Hi
> I amusing Qt5 with Visual Studio and one of my projects is giving the
> following error
> 
> c:\qt\qt5.1.1\5.1.1\msvc2012\include\qtcore\qdatetime.h(121): error C2589:
> '(' : illegal token on right side of '::'
> 1>c:\qt\qt5.1.1\5.1.1\msvc2012\include\qtcore\qdatetime.h(121): error
> C2059: syntax error : '::' 1>  moc_EventSimulator.cpp
> 
> I can get a successful compilation by adding 'NOMINMAX' to the list of pre
> processor macros
> 
> I would be grateful if someone could explain why this error occurs

The error occurs because that line is:
  static inline qint64 nullJd() { return std::numeric_limits<qint64>::min(); }

If you have a macro called "min", it will wreak havoc with the source code. 
Please stop defining macros called min. We're in 2013.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131108/13e2ef4a/attachment.sig>


More information about the Interest mailing list