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
    #5

    I'm not sure what you mean but I'm using the "Qt5 Visual Studio Add-in 1.2.4".

    I had no problems so far, not even with bigger projects. But that's because I always skipped nearly every module because I didn't need it.
    But now I wanted to try a few things and did a rebuild with many modules enabled, but cannot use them properly now..

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #6

      Can you check if in your application folder there's a .pro file??

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

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

        @mcosta There's no .pro files and qmake is not used when using Visual Studio.

        @qtacc32 First thing to do is to confirm that the used modules are enabled in the add-in. Right clik on the project -> Qt Project Settings -> Qt Modules Tab. If they are not then (obviously) enable them. If they are grayed out it means that your manual build of Qt failed to build the desired modules.
        Also, can you post the configure params you used to build Qt?

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

          Yep, the modules are enabled in the project settings (in this case, "Svg" is enabled but QtSvgWidget is not found).
          Also, as I mentioned already, ...\Qt5.4.1\qtbase\include\QtSvg contains only one file, "QtSvgDepends".

          And these are the configure params I used:

          configure -opensource -confirm-license -debug-and-release -force-debug-info -platform win32-msvc2013 -target xp -mp -ltcg -nomake examples -nomake tests -no-compile-examples -icu -openssl -no-sql-sqlite -no-opengl -no-angle -no-wmf-backend -no-qml-debug -no-native-gestures -no-inotify -no-iconv -no-mtdev -no-nis -no-cups -no-evdev -no-dbus -skip qtactiveqt -skip qtandroidextras -skip qtconnectivity -skip qtdeclarative -skip qtdoc -skip qtenginio -skip qtlocation -skip qtmacextras -skip qtquick1 -skip qtquickcontrols -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebkit -skip qtwebkit-examples -skip qtx11extras -I D:\Programming\Libraries\openssl1.0.2a\include

          I have corrected my first post, QSslSocket works (after enabling Network module).
          But I see in many folders in ...\Qt5.4.1\qtbase\include\ with only one file, Qt*Depends.

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

            Um, then it sounds like you didn't download the source for qtsvg before compiling Qt. How did you obtain the source?
            I usually use the online installer and select "Source components" when building Qt manually. There's a checkbox for each add-on module, including qtsvg.
            If you cloned the repo using git then if I remember correctly you need to get the add-ons separately, but I'm not sure. Here's the list of all Qt modules on git: Qt Project Git Repository.

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

              Btw. It's unrelated but when building from source it's nice to pass a prefix to the configure and run nmake install after the build, e.g.

              configure -prefix %CD%\..\mybuild\ <all the options>
              nmake
              nmake install
              

              This would copy all the necessary files to the prefix directory and structure them the way the precompiled builds are. You can then throw out the build directory with all the temporary files you don't need (like .obj and so forth). This reduces the size of the Qt directory significantly and it's easier to find all the modules. Maybe it's also related to your problem, as the qtsvg directory lives outside qtbase in the sources. Maybe it confuses the add-in?

              1 Reply Last reply
              1
              • 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