title: How to get rid of OCI.dll dependency when compiling static
body: <p>My application accesses an Oracle database through Qt's QSqlDatabase class.</p>
  
  <p>I'm compiling Qt as static for the release build, but I can't seem to be able to get rid of OCI.dll dependency. I'm trying to link against oci.lib (as available in Oracle's Instant Client with SDK).</p>
  
  <p>Here's my <em>configure</em> line :</p>
  
  <pre><code>configure -qt-libjpeg -qt-zlib -qt-libpng -nomake examples -nomake demos -no-exceptions -no-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -static -release -opensource -plugin-sql-oci -plugin-sql-sqlite -platform win32-msvc2005
  </code></pre>
  
  <p>I link against oci.h and oci.lib in the SDK's folder by using : </p>
  
  <pre><code>set INCLUDE=C:\oracle\instantclient\sdk\include;%INCLUDE%
  set LIB=C:\oracle\instantclient\sdk\lib\msvc;%LIB%
  </code></pre>
  
  <p>Then, once Qt is compiled, I use the following lines in my *.pro file : </p>
  
  <pre><code>QT += sql
  CONFIG += static
  LIBS += C:\oracle\instantclient\sdk\lib\msvc\oci.lib
  QTPLUGIN += qsqloci
  </code></pre>
  
  <p>Then, in my <em>main.cpp</em>, I add the following commands to statically compile OCI plugin in the application :</p>
  
  <pre><code>#include &lt;QtPlugin&gt;
  
  Q_IMPORT_PLUGIN(qsqloci)
  </code></pre>
  
  <p>After compiling the project, I test it on my workstation and it works (as I have Oracle Instant Client installed). When I try on another workstation, I always get the message: </p>
  
  <blockquote>
    <p>This application has failed to start
    because OCI.dll was not found.
    Re-installing this application may fix
    this problem.</p>
  </blockquote>
  
  <p>I don't understand why I still need OCI.dll, as my statically linked application is supposed to link to oci.lib instead.</p>
  
  <p>Is there any Qt people here that might have a solution for me ? </p>
  
  <p>Thanks a lot !</p>
  
  <p>STL</p>