Build driver plugin QIBASE Qt 4.7.3

只愿长相守 提交于 2020-01-06 08:45:07

问题


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 {
    !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."


回答1:


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)


来源:https://stackoverflow.com/questions/6516402/build-driver-plugin-qibase-qt-4-7-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!