I did. Still doesn't work
I did. Still doesn't work
you probably are already doing this, but just in case:
1)you are using the qt command prompt - right?
2)PostgreSQL dev headers/libraries are installed and added to the path?
Here are my settings after starting the qt command prompt:
Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2009.03\qt
-- PATH set to C:\Qt\2009.03\qt\bin
-- Adding C:\Qt\2009.03\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++
C:\Qt\2009.03\qt>path
PATH=C:\Qt\2009.03\qt\bin;C:\Qt\2009.03\bin;C:\Qt\ 2009.03\mingw\bin;C:\WINDOWS\S
ystem32
if you still encounter problems, try resetting that psql folder to its initial state, i.e. the folder should only contain:
main.cpp
psql.pro
README
One more thing... make sure you don't have any spaces in the path when building the plugin. It is best to use the 8.3 file/folder names or alternatively, install psql to some easy location, i.e. c:\psql.
Last edited by schnitzel; 10th November 2009 at 17:37.
Hello,
I'm on Win XP, using MingW and have spent a day and a half trying to get the
Qt Postgres driver to work.
I gave up in disgust. It's some kind of a cruel hoax.
In less than an hour I had Libpq running fine, so why even bother with this complicated
system. Life is too short.
What did you do to get libpq working???
Not so hard.. just made a pri file in the C:/psql dir with include and lib something likethen i added libpq.lib into Qt lib`s dir because it couldn`t find it and then i opened a MSVC 2008 Express Command prompt and compiled Qt`s postgresql plugin for a seconds.Qt Code:
INCLUDEPATH += $$PWD\include DEPENDPATH += $$PWD\libTo copy to clipboard, switch view to plain text mode
I created the .pri file called psql.pri with the following:
INCLUDEPATH += $$PWD\include
DEPENDPATH += $$PWD\lib
I placed the file into the c:\psql directory. I copied the libpq.lib file to the C:\Qt\2009.04\qt\lib directory. Do I do a configure -plugin-sql-psql or run qmake?
After u made the pri file go to C:\Qt\4.5.3\src\plugins\sqldrivers\psql
Open psql.pro and add:
include(C:\psql\psql.pri)
Then open a command prompt, cd to where psql.pro is, qmake, make/nmake. I don`t remember if u needed to make install, but do it anyway. The libraries will go to Qt`s plugins dir.
I can make the libraries but Qt still will not list PostgreSQL as an available database.
I had this problem before and it was resolved with this three steps
-In the prompt go to: cd %QTDIR%
-Then execute the comand: configure -debug-and-release -platform win32-g++ -qt-sql-psql -qt-gif -I C:\PostgreSQL8.1\include -L C:\PostgreSQL8.1\lib
- Finish with: make (or mingw32-make)
I'm trying to make psql driver available in Qt 4.7 but still no luck.
I manage to compile the driver and build it, all go well, the driver and the libraries were created, but still isn't in the list of available drivers.
Then I make a configure -debug-and-release -platform win32-g++ -qt-sql-psql -I C:\PostgreSQL\9.0\include -L C:\PostgreSQL\9.0\lib, and then mingw32-make, using a Qt commanda prompt and all goes well 'till the psql driver compilation, it gave and error.
I went to the qt\src\plugins\sqldrivers\psql\ and execute mingw32-make Makefile.Debug all (which is exactly where the other make file gave an error) and the make finish ok, the go to qt\ and execute mingw32-make again and this time gave an error on the sqlite driver compìlation; repeat the above steps go to the src\plugins .. and again build ok.
Execute again mingw32-make in the qt\ directory and gave an error in the bearer\generic plugin, again if I go to the directory and build it, the build goes ok;
this keep happening to all plugins, i get tired in the imageformats\gif. This are the errors:
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\.
.\include\QtCore" -I"..\..\..\..\include\QtGui" -I"..\..\..\..\include" -I"c:\Po
stgreSQL\9.0\include" -I"..\..\..\gui\image" -I"..\..\..\..\include\ActiveQt" -I
"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared
\qgifhandler.o ..\..\..\gui\image\qgifhandler.cpp
g++: CreateProcess: No such file or directory
mingw32-make[4]: *** [tmp/obj/debug_shared/qgifhandler.o] Error 1
mingw32-make[4]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats/gif'
mingw32-make[3]: *** [debug-all] Error 2
mingw32-make[3]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats/gif'
mingw32-make[2]: *** [sub-gif-make_default] Error 2
mingw32-make[2]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats'
mingw32-make[1]: *** [sub-imageformats-make_default] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/src/plugins'
mingw32-make: *** [sub-plugins-make_default-ordered] Error 2
And still the qpsql driver isn't available. Does anybody find a solution for this.
Thanks.
You don't need to build the whole Qt if the only thing you are after is recompilation of one sql plugin. Build the plugin and copy it where it belongs, nothing more.
Thanks for your reply, it is where it belongs in qt\plugins\sqldrivers\psql; but still don't appear to be available.
Could it be possible that the plugin do not find the libpq?
Bookmarks