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. [solved] errors from qt files when porting from 4.8 to 5.1
Forum Updated to NodeBB v4.3 + New Features

[solved] errors from qt files when porting from 4.8 to 5.1

Scheduled Pinned Locked Moved General and Desktop
4 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.
  • G Offline
    G Offline
    grastvei
    wrote on last edited by
    #1

    I'm trying to port a program from version 4.8 to 5.1, and after most error and issues are gone. I get stuck with a few that is from header files inside the qt5.1 library. It is the following 2 errors:

    C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\qglobal.h:890: error: 'd_ptr' was not declared in this scope
    inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \

    C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\qglobal.h:607: error: invalid operands of types 'const char*' and 'const char*' to binary 'operator<<'

    define qPrintable(string) QString(string).toLocal8Bit().constData()

    1 Reply Last reply
    0
    • G Offline
      G Offline
      grastvei
      wrote on last edited by
      #2

      here is another error I get:

      c:\qt\qt5.1.1\tools\mingw48_32\i686-w64-mingw32\include\rpcndr.h:110: error: previous declaration 'void* MIDL_user_allocate(SIZE_T)' here
      void *__RPC_USER MIDL_user_allocate(SIZE_T);

      I find it strange that these errors occur and can not find the reason.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        It is hard to guess what the causes are if you are not providing some code snippets and indication of lines associated with the errors.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          grastvei
          wrote on last edited by
          #4

          the error is in qglobal.h;
          (line 607)
          #ifndef qPrintable

          define qPrintable(string) QString(string).toLocal8Bit().constData()

          #endif

          (line888-890)
          #define Q_DECLARE_PRIVATE(Class)
          inline Class##Private* d_func() { return reinterpret_cast<Class##Private >(qGetPtrHelper(d_ptr)); }
          inline const Class##Private
          d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); }
          friend class Class##Private;

          And there are no errors in my code at this moment that I can se trigger this..

          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