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. [solved] Building Qt 4.8.4 with MySQL
Forum Updated to NodeBB v4.3 + New Features

[solved] Building Qt 4.8.4 with MySQL

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 4.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.
  • P Offline
    P Offline
    pwizard
    wrote on 15 Dec 2013, 06:32 last edited by
    #1

    I'm trying to build the "Qt Everywhere" Qt 4.8.4 from source (I haven't ported my app to Qt5 yet, but it's on my list of things to do for the next release) because I recently built a new computer and my old Qt was lost when I swapped out the hard drives and reinstalled Windows. I thought I had all of my old 4.8.4 environment backed up but I was wrong--I forgot to back up the libraries the Qt environment was linked against so I was quite surprised when my app wouldn't compile.

    Here's what I'm using:

    1. Qt-everywhere-opensource-4.8.4 sources

    2. MariaDB 5.5 libraries and headers (32 bit). Can Qt be built with MariaDB resources or does it need real MySQL? I know apps built against my old Qt environment ran fine on MariaDB.

    3. MinGW 32-bit (not sure what version but it is the latest b/c I downloaded it yesterday)

    My system specs:

    1. Intel Core i5-3470 (quad core, not overclocked)
    2. 8 GB Ram
    3. 640 GB hard drive (this is my old hard drive that originally had my old Qt environment on it)
    4. Windows 7 Home Premium 64-bit

    I've spent most of my weekend trying to compile Qt 4.8.4 again. I managed to do it once last year by following this guide: http://www.rag.com.au/linux/qt4howto.html I recall it involving lots of trial-and-error but I can't remember all the details of how I did it (I'm beginning to think I just got lucky last time). I'm building MySQL into the main Qt instead of a plugin because that is how I did it last time and it always worked perfectly after I got it built.

    I already got most of the preliminary stuff ready: I copied my MariaDB headers to "C:\include" and the libraries to "C:\ lib" (I'm trying to keep the paths as simple as possible). I already used Reimp and Dlltool to convert libmysql.lib to libmysql.a (the raw lib file builds fine on Linux but not Windows).

    The build ran for roughly half an hour until it gave me this error:
    @mingw32-make[2]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
    /plugins/qmltooling'
    mingw32-make[1]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
    /plugins'
    Makefile:858: recipe for target 'sub-plugins-make_default-ordered' failed
    mingw32-make: *** [sub-plugins-make_default-ordered] Error 2@

    I'm not sure what is causing this error (google didn't tell me anything I didn't already know). I don't see any references to MySQL so should I assume the libraries/headers got baked into the Qt properly?

    Here is how I've configured Qt:
    @configure.exe -opensource -platform win32-g++ -debug-and-release -qt-sql-mysql -qt-sql-sqlite -l mysql -I C:\include\mysql -L C:\lib@

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Dec 2013, 21:04 last edited by
      #2

      Hi,

      You should have the error point some lines earlier, these would be indicating what when wrong.

      And indeed, with the configuration option you gave, sqlite and mysql should be built-in

      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
      • P Offline
        P Offline
        pwizard
        wrote on 15 Dec 2013, 22:00 last edited by
        #3

        I tried again today and here is what cmd.exe had in its buffer when the build failed:

        @
        Makefile.Release:1079: recipe for target 'tmp/obj/release_shared/qnativewifiengi
        ne.o' failed
        mingw32-make[4]: *** [tmp/obj/release_shared/qnativewifiengine.o] Error 1
        mingw32-make[4]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
        /plugins/bearer/nativewifi'
        Makefile:56: recipe for target 'release-all' failed
        mingw32-make[3]: *** [release-all] Error 2
        mingw32-make[3]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
        /plugins/bearer/nativewifi'
        Makefile:62: recipe for target 'sub-nativewifi-make_default' failed
        mingw32-make[2]: *** [sub-nativewifi-make_default] Error 2
        mingw32-make[2]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
        /plugins/bearer'
        Makefile:91: recipe for target 'sub-bearer-make_default' failed
        mingw32-make[1]: *** [sub-bearer-make_default] Error 2
        mingw32-make[1]: Leaving directory 'c:/Qt/qt-everywhere-opensource-src-4.8.4/src
        /plugins'
        Makefile:782: recipe for target 'sub-plugins-make_default-ordered' failed
        mingw32-make: *** [sub-plugins-make_default-ordered] Error 2

        c:\Qt\qt-everywhere-opensource-src-4.8.4>@

        I'm not sure what that "qnativewifiengine" is but I know my app doesn't need wifi access to run. The only things I need no matter what are the Qt Core, GUI, SQL drivers, and Webkit. I also need QtNetwork4.dll but I'm not sure if the wifi error is part of that or something else.

        There are also a bunch of c:\mingw\include\ole2.h errors, more than the forum would allow me to post (6000 character limit). Maybe I'm missing some necessary MinGW packages/components?

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pwizard
          wrote on 15 Dec 2013, 22:07 last edited by
          #4

          Here is my current configure:
          @configure.exe -opensource -platform win32-g++ -debug-and-release -qt-sql-mysql -qt-sql-sqlite -l libmysql -I C:\include\mysql -L C:\lib -no-phonon -no-phonon-backend -nomake demos -nomake examples -no-qt3support@

          I've also tried building my app with my backed-up 4.8.4 environment while linking to the MariaDB resources. The build succeeds but my app crashes when I run it, probably because the MariaDB resources are different than what is in the compiled environment.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Dec 2013, 22:36 last edited by
            #5

            I just thought about something for MinGW, you should go with the one provided with the Qt 5 package, so you are sure to have known working compiler (and it builds Qt 4.8.5).

            As for the qwifiengine error, the failure information is missing

            On a side note, you should consider building 4.8.5 or even get the latest git version to be up to date

            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
            • P Offline
              P Offline
              pwizard
              wrote on 16 Dec 2013, 00:30 last edited by
              #6

              I'm downloading 4.8.5 now. I originally decided to build 4.8.4 because I had the tarball in my backups.

              I used the standard MinGW from SourceForge last time, so I uninstalled that and I'm currently installing the MinGW-builds version linked to on the Qt project site.

              I'll see if the new version and tools work any better.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pwizard
                wrote on 16 Dec 2013, 02:15 last edited by
                #7

                Hmmmm.... it worked this time. I guess I was using the wrong MinGW. Thanks for your help!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 16 Dec 2013, 09:22 last edited by
                  #8

                  You're welcome !

                  Not that your setup is running, please, update the thread title prepending [solved] so other forum users may know a solution has been found :)

                  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

                  1/8

                  15 Dec 2013, 06:32

                  • Login

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