Build driver plugin QIBASE Qt 4.7.3
I try to build QIBASE driver in Qt 4.7.3
ibase.pro
TARGET = qsqlibase
SOURCES = main.cpp
INCLUDEPATH += "C:/Program Files/Firebird/Firebird_2_0/include" "C:/QtSDK/Desktop/Qt/4.7.3/mingw/lib"
LIBS += -L"C:/Program Files/Firebird/Firebird_2_0/lib/fbclient_ms.lib" -L"C:/Program Files/Firebird/Firebird_2_0/lib/fbclient_bor.lib"
include(../../../sql/drivers/ibase/qsql_ibase.pri)
include(../qsqldriverbase.pri)
sql\drivers\ibase\qsql_ibase.pri
HEADERS += $$PWD/qsql_ibase.h
SOURCES += $$PWD/qsql_ibase.cpp
unix {
开发者_StackOverflow社区 !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
} else {
!contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
win32-borland:LIBS += fbclient_bor.lib
else:LIBS += -lfbclient_ms
}
}
Output:
C:\QtSDK\src\src\plugins\sqldrivers\ibase>qmake
C:\QtSDK\src\src\plugins\sqldrivers\ibase>make
make -f Makefile.Debug all
make[1]: Entering directory `C:/QtSDK/src/src/plugins/sqldrivers/ibase'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:/QtSDK/src/plugins/sqldrivers/libqsq
libased4.a -o ../../../../plugins/sqldrivers/qsqlibased4.dll tmp/obj/debug_share
d/main.o tmp/obj/debug_shared/qsql_ibase.o tmp/obj/debug_shared/moc_qsql_ibase.o
-L'c:/QtSDK/src/lib' -L'c:/QtSDK/src/lib' tmp/obj/debug_shared/qsqlibased_reso
urce_res.o "-LC:/Program Files/Firebird/Firebird_2_0/lib/fbclient_ms.lib" "-LC:/
Program Files/Firebird/Firebird_2_0/lib/fbclient_bor.lib" -lQtSqld4 -lQtCored4
c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cann
ot find -lQtSqld4
collect2: ld returned 1 exit status
make[1]: *** [../../../../plugins/sqldrivers/qsqlibased4.dll] Error 1
make[1]: Leaving directory `C:/QtSDK/src/src/plugins/sqldrivers/ibase'
make: *** [debug-all] Error 2
ld.exe: cannot find -lQtSqld4
in C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib libQtSqld4.a exist
before that I was an error "C:\QtSDK\src\bin moc.exe not found" and i copied moc.exe into "C:\QtSDK\src\bin."
the problem is solved by the advice of colleagues
Need to change the file ibase.pro only and specify the path to header files in the source directory not in directory of the SDK
ibase.pro
TARGET = qsqlibase
SOURCES = main.cpp
INCLUDEPATH += "C:/Program Files/Firebird/Firebird_2_0/include" C:/tmp/src/include
LIBS += "C:/Program Files/Firebird/Firebird_2_0/lib/fbclient_ms.lib"
include(../../../sql/drivers/ibase/qsql_ibase.pri)
include(../qsqldriverbase.pri)
精彩评论