问题描述
我尝试在Qt 4.7.3中构建QIBASE驱动程序
I try to build QIBASE driver in Qt 4.7.3
ibase.pro
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
sql\drivers\ibase\qsql_ibase.pri
HEADERS += $$PWD/qsql_ibase.h
SOURCES += $$PWD/qsql_ibase.cpp
unix {
!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
}
}
输出:
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:找不到 -lQtSqld4
ld.exe: cannot find -lQtSqld4
在C:\ QtSDK \ Desktop \ Qt \ 4.7.3 \ mingw \ lib libQtSqld4.a中存在
in C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib libQtSqld4.a exist
在出现错误未找到C:\ QtSDK \ src \ bin moc.exe"之前,我将moc.exe复制到了"C:\ QtSDK \ src \ bin"中.
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
只需更改文件ibase.pro,并在源目录中指定头文件的路径,而不在SDK目录中
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
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)
这篇关于构建驱动程序插件QIBASE Qt 4.7.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!