2

I was using QT5.4.1 version with the QWT-6.1.2 library that I've installed but in compiling I receive the error "QT_STATIC_CONST does not name a type". After some researsh how to fix that, I found that I should install the QT version 5.5. I have that already achieved but the error appears although! I use Kubuntu by the way What should I do ?

Ilya
  • 5,377
  • 2
  • 18
  • 33
Tova
  • 69
  • 1
  • 5
  • The fix is not to install Qt 5.5 but to upgrade Qwt. Are you sure it's QWT-6.1.2 and not QWT-6.1.1 ? What is your Kubuntu version ? – Ilya Feb 16 '16 at 09:10
  • https://bugs.launchpad.net/ubuntu/+source/qwt-qt5/+bug/1485213 – Marek R Feb 16 '16 at 09:19

2 Answers2

2

QT_STATIC_CONST’ does not name a type. By defining QT_STATIC_CONST just before inserting Qwt file, compilation works. - In Qt5.4 , QT_STATIC_CONST was removed from qglobal.h - Qwt 6.1.1 uses this macro, but fixed it in Qwt 6.1.2

孟吴刚
  • 21
  • 2
0

Here is the content that was removed from qglobal.h that created this issue. Adding this to your code prior to including the header file should resolve the issue.

/*
   Workaround for static const members on MSVC++.
*/

#if defined(Q_CC_MSVC)
#  define QT_STATIC_CONST static
#  define QT_STATIC_CONST_IMPL
#else
#  define QT_STATIC_CONST static const
#  define QT_STATIC_CONST_IMPL const
#endif
Aaron Swan
  • 1,206
  • 1
  • 13
  • 20