Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Problems porting from ver 4 to ver 5

Problems porting from ver 4 to ver 5

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 1.2k Views
  • 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
    dougab
    wrote on last edited by
    #1

    First, apologies if this as been answered already - whenever I try a search I get "Loading ..." but nothing ever happens.

    I have a small Windows desktop application I started a while ago under ver 4 and MinGW. I just downloaded MS-VS 2012 Express and the latest Qt, 32bit. I loaded my app and went through the process of debugging the build for the updated Qt object hierarchy, and for some bug where things like #include <QApplication> wouldn't work and I had to change it to #include <QtWidgets/QApplication>. When I got all the compiler errors fixed I now get a ton of linker errors e.g.:

    LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWidget::show(void)" (_imp?show@QWidget@@QAEXXZ) referenced in function _main

    LNK2001: unresolved external symbol "protected: virtual void __thiscall QLabel::changeEvent(class QEvent *)" (?changeEvent@QLabel@@MAEXPAVQEvent@@@Z)

    I am able to make a new Applications QtWidgets Application for the Desktop which compiles and runs and pops up a blank window.

    Thanks
    Doug

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      In Qt 4, widgets (and QApplication) were in the Qt GUI module. In Qt 5, they have been moved to the Qt Widgets module. so, you need to tell your .pro file to look for the Qt Widgets module by adding this line:
      @QT += widgets@

      See also http://qt-project.org/doc/qt-5/portingguide.html

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dougab
        wrote on last edited by
        #3

        Thanks, but that didn't eliminate any of the 600+ linker errors.

        Other suggestions?

        Regards,
        Doug

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          did you re-run qmake after adding that line ? If it doesn't help, do a complete rebuild

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dougab
            wrote on last edited by
            #5

            Success!

            I've been away from Qt programming for a while now and forgot I needed to run qmake.

            Thanks!

            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