在 Qt 中编译 InterBase 支持
我已按照 http://doc.qt.nokia.com 上的说明进行操作/stable/sql-driver.html#qibase 用于将 Interbase 支持编译到 Qt 中,并确保我的所有库都位于正确的位置。 qmake 运行成功,但是当我运行 nmake 时,我在 qsql_ibase.cpp 中收到一系列未定义的引用错误。如果我在 Qt Creator 中打开 .pro 并将鼠标悬停在引发未定义引用错误的函数之一上并跟随符号 (F2),它将带我到声明它的 ibase.h 文件。是否因为没有函数定义而引发未定义的引用错误?如果是这样的话,为什么它没有给我任何关于缺少库的错误?
输出示例:
正在创建库文件:debug\libqsqlibased4.a debug/qsql_ibase.o:在函数
getIBaseError' 中: C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase /qsql_ibase.cpp:80: 对 isc_sqlcode 的未定义引用 C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase /qsql_ibase.cpp:85: 对
isc_interprete' 的未定义引用 debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../。 ./sql/drivers/ibase/qsql_ibase.cpp:406:对 isc_dsql_free_st 的未定义引用 注释' debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../。 ./sql/drivers/ibase/qsql_ibase.cpp:421:对 isc_create_blob2 的未定义引用 ' debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../。 ./sql/drivers/ibase/qsql_ibase.cpp:427:对 isc_put_segment' 的未定义引用
这会继续出现更多错误,所有未定义的引用。
I have followed the instructions on http://doc.qt.nokia.com/stable/sql-driver.html#qibase for compiling Interbase support into Qt, and made sure all of my libraries are in the right place. qmake runs successfully, but when I run nmake, I get a series of undefined reference errors in qsql_ibase.cpp. If I open up the .pro in Qt Creator and hover over one of the functions that is throwing the undefined reference errors and follow the symbol (F2), it takes me to the ibase.h file where it is declared. Is it throwing the undefined reference errors because there is no function definition? If that is the case, why isn't it giving me any errors about a missing library?
Output example:
Creating library file: debug\libqsqlibased4.a
debug/qsql_ibase.o: In functiongetIBaseError':
isc_sqlcode'
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:80: undefined reference to
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:85: undefined reference toisc_interprete'
isc_dsql_free_st
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:406: undefined reference to
atement'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:421: undefined reference toisc_create_blob2
isc_put_segment'
'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:427: undefined reference to
This continues for many more errors, all undefined references.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这确实听起来像是您在上面链接到的页面的“故障排除”部分中提到的第一个问题:
您使用哪个编译器来编译 Qt?您从哪里获得 Interbase 库?您还需要确保可以在链接时找到这些库。如果您查看编译器的输出,它应该显示它正在搜索的所有链接目录(除了任何全局定义的,如 Windows 中的 PATH)。如果列出了包含 Interbase 库的文件夹,则可能是编译器版本不匹配。
That really sounds like the first issue mentioned under the "Troubleshooting" section of the page to which you link above:
Which compiler are you using to compile Qt, and where did you get the Interbase libraries? You also need to make sure those libraries can be found at link time. If you look at the output of your compiler, it should show you all the link directories in which it is searching (in addition to any globally defined, like PATH in Windows.) If the folder with your Interbase library is listed, it is probably that the compiler versions aren't matching.
很抱歉提出这么旧的主题,但我找到了解决方案并想与它分享。问题在于,由于条件编译定义,Interbase 的 SDK 中未定义宏
ISC_EXPORT
。请参阅此处的详细信息 - 如何通过 MinGW 为 Qt 构建 Interbase 插件Sorry for raising so old theme, but I found a solution and want to share with it. The problem is that macro
ISC_EXPORT
was not defined in Interbase's SDK due to conditional compilation defines. See details here - Howto build Interbase plugin for Qt by MinGW