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] Windows build: Many classes cannot be found
QtWS25 Last Chance

[SOLVED] Windows build: Many classes cannot be found

Scheduled Pinned Locked Moved General and Desktop
windowsmoduleincludenot found
20 Posts 4 Posters 11.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.
  • Q Offline
    Q Offline
    qtacc32
    wrote on last edited by
    #11

    I got the source from here: http://download.qt.io/official_releases/qt/5.4/5.4.1/single/qt-everywhere-opensource-src-5.4.1.zip
    The source is complete, otherwise it wouldn't work by manually adding the include dirs ;-)
    In ...\Qt5.4.1\qtsvg\ there is include\ and src\ with all the files..

    I'd want to build with -prefix and nmake install but I read somewhere that this isn't supported on windows, so I'll dig into that again first.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #12

      I'd want to build with -prefix and nmake install but I read somewhere that this isn't supported on windows

      Yeah, I've seen that too but it's working ok for at least a couple of latest releases, so I think this might be the case of outdated information (the bigger the internet the more catching up it has to do ;) ).

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtacc32
        wrote on last edited by qtacc32
        #13

        Okay, that seemed to work. The headers are there.
        But two problems occured:

        When I wanted to start a Qt application, I was getting an error that the platform plugin couldn't be loaded. So I tried to add all of these to PATH but it didn't work:
        D:\Programming\Libraries\Qt5.4.1
        D:\Programming\Libraries\Qt5.4.1\bin
        D:\Programming\Libraries\Qt5.4.1\plugins
        D:\Programming\Libraries\Qt5.4.1\plugins\platforms
        D:\Programming\Libraries\Qt5.4.1\plugins\imageformats
        I had to add an env. variable "QT_QPA_PLATFORM_PLUGIN_PATH=D:\Programming\Libraries\Qt5.4.1\plugins\platforms".
        Why is that?

        The other problem is that assistant/designer/linguist.exe all cannot be started anymore because they crash immediately (module: MSVCR120.dll).

        I have no idea at the moment what's going wrong...

        // EDIT:

        Crash callstack:

        Qt5Core.dll!qBadAlloc() Line 2848
        Qt5Core.dll!QByteArray::QByteArray(const char * data, int size) Line 1372
        Qt5Core.dll!QLibraryPrivate::fromRawMetaData(const char * raw) Line 112
        Qt5Core.dll!findPatternUnloaded(const QString & library, QLibraryPrivate * lib) Line 301
        Qt5Core.dll!QLibraryPrivate::updatePluginState() Line 715
        Qt5Core.dll!QFactoryLoader::update() Line 153
        Qt5Core.dll!QFactoryLoader::QFactoryLoader(const char * iid, const QString & suffix, Qt::CaseSensitivity cs) Line 97
        Qt5Gui.dll!`anonymous namespace'::Q_QGS_directLoader::innerFunction() Line 49
        Qt5Gui.dll!QPlatformIntegrationFactory::create(const QString & platform, const QStringList & paramList, int & argc, char * * argv, const QString & platformPluginPath) Line 70
        Qt5Gui.dll!init_platform(const QString & pluginArgument, const QString & platformPluginPath, const QString & platformThemeName, int & argc, char * * argv) Line 1010

        ?!

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by Chris Kawa
          #14

          First, after you built Qt with the prefix make sure you add it to the VS add-in correctly i.e. the prefix path, not the build path. Also, don't move your Qt build to another directory or rename it. If you did you'll have to patch the paths in Qt binaries using e.g. QtBinPatcher. Don't forget to change your solution and project Qt version too after that (right click on solution and change solution Qt version, right click on project and change Qt version in the Qt settings dialog).

          Second - please, please!, don't pollute PATH or other environment variables. You'll thank me later when you decide to have two Qt versions side by side or have Qt app installed that uses some other version. The suggested method of deployment on Windows is copying Qt libraries to the app directory, as described here. This goes for the core Qt dlls as well as platform and other plugins. For your own sake and future sanity I strongly suggest to follow that path.

          As for the crashing tools I'm not sure. Maybe some other env. variables you set are colliding? You can try to run any of the tools through profile mode in Dependency Walker and see if it crashes on loading any of the libs.

          1 Reply Last reply
          1
          • Q Offline
            Q Offline
            qtacc32
            wrote on last edited by
            #15

            Oh, I renamed the directory after nmake install finished (from Qt5.4.1build to Qt5.4.1). That could be the problem. I'm rebuilding now from scratch.
            But why are the binaries dependent on paths?!

            I am adding to PATH because it's the development machine :-P
            Otherwise I would have to copy the binaries to every single application directory I'm developing, right?

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by Chris Kawa
              #16

              I'm rebuilding now from scratch.

              No need to do that. Using the QtBinPatcher is a one-click solution to moving Qt.

              But why are the binaries dependent on paths?!

              It's a long story. In short qmake tracks which libraries were used to build Qt so that it can link to the right versions when you link your app using Qt. When you install Qt from an installer it does the patching for you but if you decide to build Qt yourself and then move it to another directory you need to patch it to fix the paths (which are embedded in qmake exec and in the .prl files in the lib directory among other places). The simplest is to build it with the desired directory set in prefix. This way you don't need any patching.
              But don't worry. This is only development side. End users don't need any of this.

              I am adding to PATH because it's the development machine :-P

              This is not an excuse. That's even worse if you ask me.

              Otherwise I would have to copy the binaries to every single application directory I'm developing, right?

              Right, but not everything. Just the dlls the app actually uses. You will need to do this anyway when deploying so I don't see a problem. Anyway, I'm guessing you're not developing a 100 apps at a time right?

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qtacc32
                wrote on last edited by
                #17

                Everything seems to work now.

                I don't plan to have more than one version for development and any program I installed so far deployed its own binaries, so they would be loaded before looking into PATH, or what issues do you mean?

                1 Reply Last reply
                0
                • Chris KawaC Offline
                  Chris KawaC Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on last edited by Chris Kawa
                  #18

                  I don't plan to have more than one version

                  This is a line from a bad Seagal movie I love to quote in this kind of situations :)
                  Assumption

                  1 Reply Last reply
                  1
                  • Q Offline
                    Q Offline
                    qtacc32
                    wrote on last edited by
                    #19

                    Hahah, yea, but for now it's just more comfortable, should I run into issues, I'll have it in mind.
                    I have kinda good control over my computer :-P

                    Thanks to everyone.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Labidi Ahmed
                      wrote on last edited by
                      #20
                      This post is deleted!
                      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