在 Qt 中编译 InterBase 支持

发布于 2024-12-14 03:37:14 字数 1310 浏览 5 评论 0原文

我已按照 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 function getIBaseError':
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:80: undefined reference to
isc_sqlcode'
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:85: undefined reference to isc_interprete'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:406: undefined reference to
isc_dsql_free_st
atement'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:421: undefined reference to isc_create_blob2
'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:427: undefined reference to
isc_put_segment'

This continues for many more errors, all undefined references.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

娇妻 2024-12-21 03:37:14

确实听起来像是您在上面链接到的页面的“故障排除”部分中提到的第一个问题:

您应该始终使用已编译的客户端库
与您的项目使用的编译器相同。如果你无法获得
自己编译客户端库的源代码发行版,您
必须确保预编译库与您的兼容
编译器,否则你会得到很多“未定义符号”错误。
一些编译器有转换库的工具,例如 Borland 提供了
工具 COFF2OMF.EXE 用于转换已生成的库
微软 Visual C++。

您使用哪个编译器来编译 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:

You should always use client libraries that have been compiled with
the same compiler as you are using for your project. If you cannot get
a source distibution to compile the client libraries yourself, you
must make sure that the pre-compiled library is compatible with your
compiler, otherwise you will get a lot of "undefined symbols" errors.
Some compilers have tools to convert libraries, e.g. Borland ships the
tool COFF2OMF.EXE to convert libraries that have been generated with
Microsoft Visual C++.

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.

赠意 2024-12-21 03:37:14

很抱歉提出这么旧的主题,但我找到了解决方案并想与它分享。问题在于,由于条件编译定义,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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文