Recently had a lot of trouble making QPSQL driver available in QT 4.3.1 version. But fun part was that - driver loaded correctly then i copied all dll from {%pgsql)\bin\ files to executable directory.
Copied files list.
comerr32.dll
depends.dll
gssapi32.dll
iconv.dll
k5sprt32.dll
krb5_32.dll
libeay32.dll
libiconv2.dll
libintl3.dll
libpq.dll
libxml2.dll
libxslt.dll
ssleay32.dll
Another interesting thing, that if I rename to something else, driver still loads correctly :D :D. Perhaps I'm missing something, but at least it works now :)
By the way if drivers still does not get loaded try add this line in file
qApp->addLibraryPath( qApp->applicationDirPath() + "/plugins");
And plugins directory should look like : plugins\sqldrivers\
-----------------------------------
我先安装了PostgreSQL 8.2。
再装DEV-C++
再Qt.
环境变量如下:
INCLUDE=D:\PostgreSQL\8.2\include;D:\Dev-Cpp\include;D:\qt\4.3.4\include
LIB=D:\PostgreSQL\8.2\lib;D:\Dev-Cpp\lib;D:\qt\4.3.4\lib
PATH=D:\PostgreSQL\8.2\bin;D:\Dev-Cpp\bin;D:\qt\4.3.4\bin
后运行 -share -release -qt-sql-psql -qt-sql-odbc -qt-zlib -qt-gif -qt-libpng -qt-libjpeg -qt-style-windowsxp -platform win32-g++ -L D:\PostgreSQL\8.2\bin -I D:\PostgreSQL\8.2\include
到此一切正常。
可是运行mingw32-make后出现以下问题。
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,d:\Qt\4.3.4\lib\ -o
..\..\lib\ object_script. -L"d:\Qt\4.3.4\lib" -L"d:\Post
greSQL\8.2\lib" -L"d:\Dev-Cpp\lib" -L"d:\qt\4.3.4\lib" -L"d:\Qt\4.3.4\lib" tmp\o
bj\release_shared\QtSql_resource_res.o -LD:\PostgreSQL\8.2\lib -lpq -lws2_32 -la
dvapi32 -lodbc32 -lQtCore4
D:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\: cannot f
ind -lpq
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\] Error 1
mingw32-make[2]: Leaving directory `D:/qt/4.3.4/src/sql'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `D:/qt/4.3.4/src/sql'
mingw32-make: *** [sub-sql-make_default-ordered] Error 2
请问各位朋友,这是怎么回事?如何解决?
不胜感激
再装DEV-C++
再Qt.
环境变量如下:
INCLUDE=D:\PostgreSQL\8.2\include;D:\Dev-Cpp\include;D:\qt\4.3.4\include
LIB=D:\PostgreSQL\8.2\lib;D:\Dev-Cpp\lib;D:\qt\4.3.4\lib
PATH=D:\PostgreSQL\8.2\bin;D:\Dev-Cpp\bin;D:\qt\4.3.4\bin
后运行 -share -release -qt-sql-psql -qt-sql-odbc -qt-zlib -qt-gif -qt-libpng -qt-libjpeg -qt-style-windowsxp -platform win32-g++ -L D:\PostgreSQL\8.2\bin -I D:\PostgreSQL\8.2\include
到此一切正常。
可是运行mingw32-make后出现以下问题。
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,d:\Qt\4.3.4\lib\ -o
..\..\lib\ object_script. -L"d:\Qt\4.3.4\lib" -L"d:\Post
greSQL\8.2\lib" -L"d:\Dev-Cpp\lib" -L"d:\qt\4.3.4\lib" -L"d:\Qt\4.3.4\lib" tmp\o
bj\release_shared\QtSql_resource_res.o -LD:\PostgreSQL\8.2\lib -lpq -lws2_32 -la
dvapi32 -lodbc32 -lQtCore4
D:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\: cannot f
ind -lpq
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\] Error 1
mingw32-make[2]: Leaving directory `D:/qt/4.3.4/src/sql'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `D:/qt/4.3.4/src/sql'
mingw32-make: *** [sub-sql-make_default-ordered] Error 2
请问各位朋友,这是怎么回事?如何解决?
不胜感激