QPSQL Plugin on Windows
-
i integrated the LIBS+=-LC:/psql/folder_where_libqp_can_be_found
in my psql.pro file like this:TARGET = qsqlpsql
SOURCES = main.cpp
OTHER_FILES += psql.json
include(../../../sql/drivers/psql/qsql_psql.pri)PLUGIN_CLASS_NAME = QPSQLDriverPlugin
include(../qsqldriverbase.pri)
LIBS+=-LC:/psql/liband got this output, surprisingly without errors; but the "driver not loaded" error still comes as soon as I test with
@qDebug() << "Error = " << db.lastError().text();@C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\qmake.exe "INCLUDEPATH+=C:\psql\includeö ôL
IBS+=c:\psql\lib\libpq.libö psql.pro" -o Makefile psql.pro
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
sqldrivers/psql'
g++ -Wl,-s -shared -Wl,--out-implib,C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\plugins\sqldr
ivers\libqsqlpsql.a -o ........\plugins\sqldrivers\qsqlpsql.dll .obj/release_
shared/main.o .obj/release_shared/qsql_psql.o .obj/release_shared/moc_qsql_psql.
o -Lc:\psql\lib -lpq -LC:/psql/lib -LC:\Qt\Qt5.0.2\5.0.2\mingw47_32\lib -lQt5Sq
l -lQt5Core
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
qldrivers/psql'
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
sqldrivers/psql'
g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wa
ll -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEP
TIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\psql\includeö" -I"ôLIBS+=
c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include"
-I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_
32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2\Qt
Sql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtCore" -I".moc\debug_shared" -I"
........\mkspecs\win32-g++" -o .obj\debug_shared\qsql_psql.o ......\sql\dri
vers\psql\qsql_psql.cpp
cc1plus.exe: warning: psql.pro: not a directory [enabled by default]
C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I.
-I"C:\psql\includeö" -I"ôLIBS+=c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt
5.0.2\5.0.2\mingw47_32\include" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql"
-I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\m
ingw47_32\include\QtSql\5.0.2\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\Q
tCore" -I".moc\debug_shared" -I"........\mkspecs\win32-g++" -D__GNUC__ -DWIN3
2 ......\sql\drivers\psql\qsql_psql.h -o .moc\debug_shared\moc_qsql_psql.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wa
ll -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEP
TIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\psql\includeö" -I"ôLIBS+=
c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include"
-I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_
32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2\Qt
Sql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtCore" -I".moc\debug_shared" -I"
........\mkspecs\win32-g++" -o .obj\debug_shared\moc_qsql_psql.o .moc\debug_s
hared\moc_qsql_psql.cpp
cc1plus.exe: warning: psql.pro: not a directory [enabled by default]
g++ -shared -Wl,--out-implib,C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\plugins\sqldrivers\l
ibqsqlpsqld.a -o ........\plugins\sqldrivers\qsqlpsqld.dll .obj/debug_shared/
main.o .obj/debug_shared/qsql_psql.o .obj/debug_shared/moc_qsql_psql.o -Lc:\psq
l\lib -lpq -LC:/psql/lib -LC:\Qt\Qt5.0.2\5.0.2\mingw47_32\lib -lQt5Sqld -lQt5Cor
ed
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
qldrivers/psql'after that i put the LIBS+=-LC:/psql/folder_where_libqp_can_be_found
in my psql.pro file like this:TARGET = qsqlpsql
SOURCES = main.cpp
OTHER_FILES += psql.json
include(../../../sql/drivers/psql/qsql_psql.pri)
LIBS+=-LC:/psql/libPLUGIN_CLASS_NAME = QPSQLDriverPlugin
include(../qsqldriverbase.pri)and got this output,
C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\qmake.exe "INCLUDEPATH+=C:\psql\includeö ôL
IBS+=c:\psql\lib\libpq.libö psql.pro" -o Makefile psql.pro
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
sqldrivers/psql'
mingw32-make[1]: Nothing to be done for 'all'.
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
qldrivers/psql'
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
sqldrivers/psql'
mingw32-make[1]: Nothing to be done for 'all'.
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
qldrivers/psql'but the "driver not loaded" error still comes as soon as I test with
@qDebug() << "Error = " << db.lastError().text();@- which is the correct output?
- i think i should obtain the qsqlpsql.dll file after this is correctly created, which should be copied to c:[Qt]\mingw47_32\plugins\sqldrivers\
what's wrong?
thanks for your input -
I don't know if it's the copy/paste or something else, but you are having a lot of strange char in your mignw32-make output.
And this line:
@cc1plus.exe: warning: psql.pro: not a directory [enabled by default]@looks suspicious