为什么QOCI插件不起作用 [英] Why QOCI plugin isn't working

查看:167
本文介绍了为什么QOCI插件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Qt与QOCI结合使用(实际上,还与其他插件一起使用),但是由于某些原因,我不能.这是我的工作和结果:

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 插件构建成功.

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

2-复制了插件debug&将dll和lib文件发布到plugins/sqldrivers,将OCI.DLL发布到%WINDIR%\ system32 (插件/sqldrivers是QPSQL和QMYSQL等其他插件所在的地方)

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)返回false ,其中对于QMYSQL和QPSQL返回true.我对QMYSQL和QPSQL做过同样的事情

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(); 返回的字符串列表中没有QOCI.但是有QMYSQL,QPSQL和其他一些.

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

其他检查:使用依赖关系行程序打开了qsqloci4.dll,无法找到3个dll:1-QtCore4.dll 2-QtSql4.dll 3-MSVSC80.dll但是,也无法找到他们与依赖行者打开qsqlpsql.dll时.我相信由于依赖于qsqloci4.dll,加载dll不会失败.但仍然欢迎任何想法.

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");

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.

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

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?

谢谢.

推荐答案

您需要在包含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).

这篇关于为什么QOCI插件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆