Loading the OCI driver on the MAC
-
sqlplus gave me the message with the other directory, not my application.
DYLD_LIBRARY_PATH=usr/local/oracle/instantclient_10_2
I did see the message about i386 somewhere in this process but making the suggested changes to the .pro file did not change the results.
I am wondering if I have the wrong version of oracle installed.
-
As far as I know there's only one version of the oracle instant client for the Mac (32 bit Intel).
But the first step is to make sqplus running, as long as you cannot connect to your database with that tool it's quite useless to try with Qt, as you cannot be sure to have a working oracle installation.
-
Thanks for your help. I checked and sqlplus is an i386 while the library is x86-64. I will post more when I know something further.
-
Ok, seems you mix sqlplus from /b/32.... with instant client libs from /usr/local/....
You should check your paths here.
-
I have re-installed the latest Oracle. I now have sqlplus working, but still can not load the OCI plugin. I have attempted to rebuild the plugin against the new installation and can not link the plugin. I either get 'library not found for -lclntsh' or if I remove the requirement for the library, a lot of missing references from the linker. I don't believe that the referenced library is included in the installation. Does it need to be built also or am I missing something.
-
libclntsh is included in the instant client development package.
- check the architectures in libclntsh
- make sure to build your application and the SQL plugin against the very same architecture(s)
See previous comments for how to do that
-
After time to get some other work done, I am back at this problem.
One missing point is the need to link the dynamic library:
ln -s libclntsh.dylib.10.1 libclntsh.dylib
I am using QtCreator to build libqsqloci.dylib and now I am able to build the libqsqloci.dylib, however I still can not get to work. I have attempted to load the file as a plugin (QPluginLoader) and get the message that it is not a valid plugin.
Should the library be built from the command line instead?
Both the application, the built library and the installed Oracle are X86-64
The following environment variables are set:
ORACLE_HOME=/usr/local/oracle/instantclient_10_2
DYLD_LIBRARY_PATH=/usr/local/oracle/instantclient_10_2/libs
PATH=/usr/bin:/Users/wscadmin/QtSDK/Desktop/Qt/4.7.3/gcc/bin:/usr/bin:/bin:/usr/sbin:/sbinIs there some other variable needed?
I do not really need the functionality of the plug in and it would be OK to load the plugin statically, but every time I provide the Oracle library to the executable, it ceases to function.
-
Make sure to build the plugin and your application only for the x86/i386 architecture. The instant client libraries usually are not fat binaries. Add the CONFIG entries to the plugin's .pro file as well as to that of your application.
-
I added the CONFIG entries to both with no impact. Also, I have installed the x86_64 version of the instant client for MAC. lipo reports: Non-fat file: libclntsh.dylib is architecture: x86_64
-
Sorry, I'm out here. I don't know how your Qt, the plugin and the app is built in detail. All I can say is that it works in principle. I have a manually built Qt here, with x86/i386 and ppc arch, no 64 bit.
If you have a x86_64 oracle installation, your Qt must contain x86_64 architecture too. The plugin must be built using only x86_64 arch, as well as your application. This should be everything.
-
While I ultimately got this to work on Snow Leopard, we are moving to Lion and the existing OCI library does not appear to work on Lion. I can even take the Snow Leopard application with the OCI driver included in it and get the message 'Driver Not Loaded'. Is there something special that needs to be done on Lion to make this work?