为什么 QOCI 插件不起作用

发布于 2024-11-13 02:36:48 字数 1218 浏览 2 评论 0原文

我正在尝试将 Qt 与 QOCI 一起使用(实际上,还有其他插件),但由于某种原因我不能。这是我所做的和结果:

1- http:// doc.qt.nokia.com/latest/sql-driver.html#qoci 插件构建成功。

2-复制插件调试&将dll和lib文件释放到plugins/sqldrivers,将OCI.DLL释放到%WINDIR%\system32(plugins/sqldrivers是QPSQL和QMYSQL等其他插件所在的位置)

3- QSqlDatabase::isDriverAvailable(QOCI)对于 QMYSQL 和 QPSQL 返回 true,则返回 false。我对 QMYSQL 和 QPSQL 做了同样的事情

4- QStringList qsl = QSqlDatabase::drivers(); 返回的字符串列表中没有QOCI。然而还有QMYSQL、QPSQL 和其他一些。

额外检查:使用dependency walker打开qsqloci4.dll,无法找到3个dll:1-QtCore4.dll 2-QtSql4.dll 3-MSVSC80.dll 但是打开时也无法找到它们qsqlpsql.dll 与依赖步行器。我相信加载dll并没有因为qsqloci4.dll的依赖而失败。但仍然欢迎任何想法。

新闻

LoadLibrary(_T("C:\\QtSDK\\Desktop\\Qt\\4.7.3\\msvc2005\\plugins\\sqldrivers\\qsqloci4.dll");

LoadLibrary(_T("C:\\QtSDK\\Desktop\\Qt\\4.7.3\\msvc2005\\plugins\\sqldrivers\\qsqlocid4.dll");

失败了!!!请注意,这两个文件都存在于给定路径中。

我相信由于这个错误,Qt 也无法加载插件。现在的问题有点不同,但是为什么 LoadLibrary 在这种情况下会失败?有什么想法吗?

提前致谢。

I am trying to use Qt with QOCI (actually, along with other plugins as well) but for some reason I cannot. Here is what I did and result:

1- http://doc.qt.nokia.com/latest/sql-driver.html#qoci
plug-in is built successfully.

2- copied the plugin debug & release dll and lib files to plugins/sqldrivers and OCI.DLL to %WINDIR%\system32 (plugins/sqldrivers is where other plugins such as QPSQL and QMYSQL are)

3- QSqlDatabase::isDriverAvailable(QOCI) returns false where it returns true for QMYSQL and QPSQL. I did the same for QMYSQL and QPSQL

4- QStringList qsl = QSqlDatabase::drivers();
There is no QOCI in the string list returned. however there is QMYSQL, QPSQL and some others.

additional checks: opened qsqloci4.dll with dependency walker, 3 dlls were impossible to locate: 1-QtCore4.dll 2-QtSql4.dll 3-MSVSC80.dll However it is also impossible to locate them when opening qsqlpsql.dll with dependency walker. I believe that loading dll did not fail because of dependencies of qsqloci4.dll. But still, any ideas are welcomed.

NEWS

LoadLibrary(_T("C:\\QtSDK\\Desktop\\Qt\\4.7.3\\msvc2005\\plugins\\sqldrivers\\qsqloci4.dll");

and

LoadLibrary(_T("C:\\QtSDK\\Desktop\\Qt\\4.7.3\\msvc2005\\plugins\\sqldrivers\\qsqlocid4.dll");

fails!!! Please not that both of those files exist in the given path.

I believe that Qt also cannot load the plugin due to this error. Now question is a bit different but, why does LoadLibrary fail in this case? Any ideas?

Thanks in advance.

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

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

发布评论

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

评论(2

梦忆晨望 2024-11-20 02:36:48

如何在 Windows 上构建插件

在 Oracle 客户端安装 CD 中的 Oracle 客户端安装程序中选择“程序员”选项足以构建插件。

按如下方式构建插件(这里假设 Oracle 客户端安装在 C:\oracle 中):

set INCLUDE=%INCLUDE%;c:\oracle\oci\include
set LIB=%LIB%;c:\oracle\oci\lib\msvc
cd %QTDIR%\src\plugins\sqldrivers\oci
qmake -o Makefile oci.pro
nmake

如果您没有使用 Microsoft 编译器,请将上面一行中的 nmake 替换为 make。

运行应用程序时,您还需要将 oci.dll 路径添加到 PATH 环境变量中:

set PATH=%PATH%;c:\oracle\bin

How to Build the Plugin on Windows

Choosing the option "Programmer" in the Oracle Client Installer from the Oracle Client Installation CD is sufficient to build the plugin.

Build the plugin as follows (here it is assumed that Oracle Client is installed in C:\oracle):

set INCLUDE=%INCLUDE%;c:\oracle\oci\include
set LIB=%LIB%;c:\oracle\oci\lib\msvc
cd %QTDIR%\src\plugins\sqldrivers\oci
qmake -o Makefile oci.pro
nmake

If you are not using a Microsoft compiler, replace nmake with make in the line above.

When you run your application you will also need to add the oci.dll path to your PATH environment variable:

set PATH=%PATH%;c:\oracle\bin
许久 2024-11-20 02:36:48

您需要在包含 exe 的目录中创建一个名为 sqldrivers 的文件夹。将您正在使用的所有 SQL 驱动程序 DLL 放入其中(对于 oracle oci.dll、ociw32.dll、oraociei12.dll、oraons.dll、qsqloci4.dll、qsqlocid4.dll)。

You need to create a folder call sqldrivers in the directory containing your exe. Put all the SQL driver DLLs you are using in there (for oracle oci.dll, ociw32.dll, oraociei12.dll, oraons.dll, qsqloci4.dll, qsqlocid4.dll).

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