简体   繁体   English

Qt Oracle插件注册

[英]Qt Oracle plug-in registration

I built the plug-in for oracle database and have been working very happily with my Qt program and Oracle 10g XE. 我构建了用于oracle数据库的插件,并且一直非常愉快地使用我的Qt程序和Oracle 10g XE。

When the plug-in was built, the files qsqlocid4.dll and qsqlocid4.lib were created; 构建该插件时,将创建文件qsqlocid4.dll和qsqlocid4.lib。 and I simply copied these files to this location: 我只是将这些文件复制到此位置:

C:\\QtSDK\\Desktop\\Qt\\4.7.4\\msvc2008\\plugins\\sqldrivers; C:\\ QtSDK \\ Desktop \\ Qt \\ 4.7.4 \\ msvc2008 \\ plugins \\ sqldrivers; all works perfect. 一切都完美。

However I have a Qt and Oracle installation on other computer, and I need to re-compile this same program in this "new" machine. 但是,我在其他计算机上安装了Qt和Oracle,因此需要在此“新”计算机上重新编译同一程序。 I thought that it was only necessary to copy the *.lib and *.dll files (the already built driver) to the plug-ins folder of the Qt installation in this second machine to make it work (this computer also has VS2008 installed, so the compiler that generated the plug-in is the same for both machines). 我以为只需要将* .lib和* .dll文件(已构建的驱动程序)复制到第二台计算机中Qt安装的插件文件夹中即可正常工作(该计算机还安装了VS2008,因此,生成插件的编译器对于两台计算机都是相同的。

Unfortunately when I execute my program, in this second machine, it tells me it can't load the Oracle plugin. 不幸的是,当我在第二台机器上执行程序时,它告诉我无法加载Oracle插件。

I think it is because I only copied the driver and not created it in this second machine; 我认为这是因为我只复制了驱动程序,而未在第二台计算机中创建它。 and because of this, I suppose that in the process of creating the driver, Qt enables or registers it for future use or something. 因此,我想在创建驱动程序的过程中,Qt启用或注册了该驱动程序以备将来使用。

Is there a way I can register or enable the driver, so I don't have to build it over and over in every machine that needs it? 有没有一种方法可以注册或启用驱动程序,所以我不必在需要它的每台机器上一遍又一遍地构建它?

There is a good chance that when you have compiled your Qt dlls on the first machine and you copied them to the specified directory, the Qt system still used them from the original directory ... somehow I kind of recall that Qt embeds the installation path into the executables... might be I'm wrong. 当您在第一台计算机上编译Qt dll并将其复制到指定目录时,Qt系统仍然有机会从原始目录中使用它们……以某种方式,我回想起Qt嵌入了安装路径进入可执行文件...可能是我错了。 You should put the plugins in the "sqldrivers" directory which is in the directory where your application runs (ie: the "exe" trying to load the plugin and the "sqldrivers" sub directory are in the same directory). 您应该将插件放在应用程序运行目录中的“ sqldrivers”目录中(即:试图加载插件的“ exe”和子目录“ sqldrivers”位于同一目录中)。

Or yes, you can re-compile them on the new machine. 或者,可以在新计算机上重新编译它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM