June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

Rebuild of QtSql*

Page  
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

 Signature 

Regards,

William

16 replies

June 24, 2011

sigrid sigrid
Lab Rat
144 posts

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)

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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

 Signature 

Regards,

William

June 24, 2011

sigrid sigrid
Lab Rat
144 posts

Sorry, the path should be

yourQtVersion/SRC/plugins/sqldrivers/psql

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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

 Signature 

Regards,

William

June 24, 2011

Volker Volker
Robot Herder
5428 posts

QtSql uses plugins by default. Did you change this?

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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

 Signature 

Regards,

William

June 24, 2011

Volker Volker
Robot Herder
5428 posts

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

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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?

 Signature 

Regards,

William

June 24, 2011

Volker Volker
Robot Herder
5428 posts

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

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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

 Signature 

Regards,

William

June 24, 2011

sigrid sigrid
Lab Rat
144 posts

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:

  1. qmake "sql-drivers += psql"
  2. nmake

Does that work?

June 24, 2011

WilliamU WilliamU
Lab Rat
63 posts

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.

 Signature 

Regards,

William

June 25, 2011

WilliamU WilliamU
Lab Rat
63 posts

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.

 Signature 

Regards,

William

June 27, 2011

sigrid sigrid
Lab Rat
144 posts

The error you are receiving:

  1. 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.

June 27, 2011

peter999 peter999
Lab Rat
2 posts

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

Page  
1

  ‹‹ [SOLVED] How to close all files with a single command in Qt Creator editor?      there must be a network proxy settings option in options. ››

You must log in to post a reply. Not a member yet? Register here!