Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 4.7.4 qmetatype errors in Linux
Forum Updated to NodeBB v4.3 + New Features

Qt 4.7.4 qmetatype errors in Linux

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danil_mark
    wrote on last edited by
    #1

    Hello, dear Qt developers! I got a problem and I can't understand why it appears. I downloaded Qt 4.7.4 sources, build it in Linux (Mint16 if it matters).
    I used Qt in VS before, so I generate .pro files using Qt add-in and copied whole project to Linux. Fixed some path issues etc, and now when I try to compile my project there one of the errors I get is the

    • /opt/Qt4.7.4/include/QtCore/qmetatype.h:271: error: definition of 'static int QMetaTypeId<QMap<int, double>>::qt_metatype_id()' is not in namespace enclosing 'QMetaTypeId<QMap<int, double>>' [-fpermissive]

    !http://gyazo.com/0343f42924c72d5a350e586f52656540.png(error output)!

    When I run my project in Windows there are no such error!

    Whats worng? How to fix that problem if its possible?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      bq. When I run my project in Windows there are no such error!

      Nothing to do with running your application. You are not getting past compilation.

      bq. Whats worng? How to fix that problem if its possible?

      We cannot see your code so we cannot know exactly what you are doing to trigger this. At a guess you are declaring a QMetaTypeId specialisation in a namespace by incorrectly using Q_DECLARE_METATYPE. GCC is not compiling the resulting source where MSVC has been more lax.

      You should read the docs about Q_DECLARE_METATYPE and namespaces:
      http://qt-project.org/doc/qt-4.8/qmetatype.html#Q_DECLARE_METATYPE

      Is there a reason you are using an old version of Qt?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved