PostgreSQL plugin building in Windows 7
-
It can't find the libpq-fe.h header file, are you sure you added the include path where that file can be found ?
-
The file is in C:\PostgreSQL\9.3\include:
-
Change the \ to / for the paths you give to qmake. Also on windows Qt uses unix style path, so you are giving it invalid paths.
-
same result :)
......\sql\drivers\psql\qsql_psql.cpp:59:22: fatal error: libpq-fe.h: No such
file or directory
#include <libpq-fe.h>
^
compilation terminated.
Makefile.Release:493: recipe for target '.obj/release_shared/qsql_psql.o' failedmingw32-make[1]: *** [.obj/release_shared/qsql_psql.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/5.1.1/Src/qtbase/src/plugins/sqldriver
s/psql'
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2 -
Check the content of the Makefile to see if there's a line containing the path to PostgreSQL includes
-
The Makefile which is in C:/Qt/5.1.1/Src/qtbase/src/plugins/sqldrivers/psql has the line:
Command: C:\Qt\5.1.1\mingw48_32\bin\qmake.exe INCLUDE+=“C:/PostgreSQL/9.3/include” LIBS+=“C:/PostgreSQL/9.3/lib/libpq.lib” -o Makefile psql.pro
The Makefile which is in C:\Qt\5.1.1\mingw48_32\bin has the line:
Command: C:\Qt\5.1.1\mingw48_32\bin\qmake.exe "INCLUDEPATH+=C:\Program Files\PostgreSQL\9.3\include" "LIBS+=C:\Program Files\PostgreSQL\9.3\lib\libpq.lib" -o Makefile C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql\psql.pro
-
Why do you have a Makefile in the C:\Qt\5.1.1\mingw48_32\bin folder ?
You should clean everything and then try to build the plugin again
-
No, PostgreSQL seems to be installed fine, just clean the sources and check whether you have something unusual in the mingw related folders
-
Here is what I did:
-Re-installed Qt
-Opened the Console from Qt's folder in start menu
-Executed:C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>qmake INCLUDEPATH+="C:/PostgreSQL/9.3/include" LIBS+="C:/PostgreSQL/9.3/lib/libpq.lib
After that:
C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-makeAnd the result:
from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\incl
ude\c++\bits\stl_algo.h:65,
from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\incl
ude\c++\algorithm:62,
from C:\Qt\5.1.1\mingw48_32\include/QtCore/qglobal.h:80,
from C:\Qt\5.1.1\mingw48_32\include/QtCore/qnamespace.h:45,
from C:\Qt\5.1.1\mingw48_32\include/QtCore/qobjectdefs.h:45,
from C:\Qt\5.1.1\mingw48_32\include/QtCore/qobject.h:48,
from C:\Qt\5.1.1\mingw48_32\include/QtCore/qplugin.h:45,
from C:\Qt\5.1.1\mingw48_32\include\QtSql/qsqldriverplugin.h:45
,
from main.cpp:42:
c:\qt\tools\mingw48_32\i686-w64-mingw32\include\sys\timeb.h:90:8: error: previou
s definition of 'struct timespec'
struct timespec {
^
Makefile.Release:397: recipe for target '.obj/release_shared/main.o' failed
mingw32-make[1]: *** [.obj/release_shared/main.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/5.1.1/Src/qtbase/src/plugins/sqldriver
s/psql'
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2Is it possible that for Qt ver. 5.1.1 the building of the plugin is done in different way?
-
Just stumbled upon "this":http://qt-project.org/forums/viewthread/24460
Worth a try