Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Rebuild of QtSql*
Forum Updated to NodeBB v4.3 + New Features

Rebuild of QtSql*

Scheduled Pinned Locked Moved Qt Creator and other tools
17 Posts 4 Posters 7.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.
  • W Offline
    W Offline
    WilliamU
    wrote on last edited by
    #1

    Hi all,

    I had assumed that this question had been asked many times before but searching finds nothing, either that or my search criterion is wrong, so my apologies in advance if this is the case.

    I want to add PostgreSQL support to my QtSql* libraries but don't want (nor need) to rebuild all of the others is there a way this library can be rebuilt in a stand-alone manner?

    --
    William

    Regards,

    William

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sigrid
      wrote on last edited by
      #2

      You can build only the Postgres driver by opening a command prompt and going to

      yourQtVersion/plugins/sqldrivers/psql

      and typing

      qmake
      nmake (if using visual studio)

      1 Reply Last reply
      0
      • W Offline
        W Offline
        WilliamU
        wrote on last edited by
        #3

        Sorry Sigrid I don't have a psql directory in /Qt/4.7.2/plugins/sqldrivers/ or any other for that matter all I have is qsqlite* files. Or am I missing something?

        My present QtSql is built using x64 Intel compiler with qsqlite and odbc support I simply want to add psql to this as well.

        --
        William

        Regards,

        William

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sigrid
          wrote on last edited by
          #4

          Sorry, the path should be

          yourQtVersion/SRC/plugins/sqldrivers/psql

          1 Reply Last reply
          0
          • W Offline
            W Offline
            WilliamU
            wrote on last edited by
            #5

            Thanks Sigrid. I have that path, but of course it still does not answer my original question as this will build a plugin and I don't use plugins, hence my need to rebuild the QtSql library.

            --
            William

            Regards,

            William

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              QtSql uses plugins by default. Did you change this?

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • W Offline
                W Offline
                WilliamU
                wrote on last edited by
                #7

                Yes I did. I used -qt-sql-odbc -qt-sql-sqlite in my config.cache file.

                Regards,

                William

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  So you will have to reconfigure Qt and add -qt-sql-psql to the configure line and recompile Qt.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    WilliamU
                    wrote on last edited by
                    #9

                    Yes, I am aware of this, but that will rebuild everything won't it? I don't really want (or think I need) to do this. I was simply wanting to rebuild the QtSql library with psql support. Are you telling me there is no way to rebuild a single library and I have to rebuild all?

                    Regards,

                    William

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      I'm not sure if it rebuilds everything, you'll have to try, sorry :-/

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • W Offline
                        W Offline
                        WilliamU
                        wrote on last edited by
                        #11

                        I will, and thank you both for your time. And for those interested I'll post the outcome over the weekend.

                        Regards,

                        William

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          sigrid
                          wrote on last edited by
                          #12

                          You can also try the following, hopefully that allows you to only rebuild the QtSql library with psql support:

                          Go to the src\sql directory and type:

                          @qmake "sql-drivers += psql"
                          nmake@

                          Does that work?

                          1 Reply Last reply
                          0
                          • W Offline
                            W Offline
                            WilliamU
                            wrote on last edited by
                            #13

                            Hi Sigrid,

                            I tried your suggestion and it looked promising but compilation stopped saying it cannot find "pg_config.h" and on searching the hard disk the only files I have are:

                            "pg_config.h.in" and "pg_config.h.win32" in the postgresql-9.0.4/src/include directories.

                            So I now have a ! above my head.

                            Of course it may help if I actually build the client first.

                            Regards,

                            William

                            1 Reply Last reply
                            0
                            • W Offline
                              W Offline
                              WilliamU
                              wrote on last edited by
                              #14

                              Well I am still no further forward with this, as I can't build the PostgreSQL client / library using my compiler (Intel) nor with Visual Studio 2010 as there is no support, so I guess this one goes on the back burner for now.

                              Regards,

                              William

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                sigrid
                                wrote on last edited by
                                #15

                                The error you are receiving:

                                @cannot find “pg_config.h@

                                seems to indicate that you don't have the prebuilt version of psql installed. Is that the case? If so, you could try replacing the package with the prebuilt version of psql to see if that helps.

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  peter999
                                  wrote on last edited by
                                  #16

                                  It's not enough to install PostgreSQL and then call the nmake. You have to tell the compiler where PostGreSQL has its header and libs.

                                  Install http://www.postgresql.org/download/windows "One click installer" to any 64 Bit Windows machine, it includes libs and headers. Extract the lib and include folders to your dev machine. Then run configure again and add -qt-sql-psql and the include/lib pathes.
                                  Configure created the missing qmake files, there is no need to run all again, go to /%qtdir%/src/plugins/sqldrivers/psql and run "nmake", now your 64 Bit Plugins should be created...

                                  And it works with VS 2010 ! You only have to set the correct mkdefs....

                                  Regards,
                                  Peter

                                  1 Reply Last reply
                                  0
                                  • W Offline
                                    W Offline
                                    WilliamU
                                    wrote on last edited by
                                    #17

                                    Hi,

                                    Well I downloaded the installer as suggested by peter999 and I used the
                                    @
                                    qmake "sql-drivers += psql"
                                    nmake
                                    @ as suggested by Sigrid and all went well I got a new QtSql4 .dll and .lib files however when I rebuilt an existing application that uses this library it crashed at startup! I've since done the reverse of Sigrid's suggestion and again rebuilt the application, this time it ran as expected.

                                    I don't want to waste anyones time with this it can wait until I upgrade to a new SDK.

                                    Regards,

                                    William

                                    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