title: ldd outputs statically linked on a shared library
body: <p>I am trying to create a shared library libddv3djava.so</p>
  
  <p>I compile sources for libddv3djava.so like so:</p>
  
  <pre><code>~/Programming/intellijprojects/ddv3dbindingstest/src $ g++ -c -Wall -Werror -I. -I /usr/lib/jvm/java-8-oracle/include/ -I /usr/lib/jvm/java-8-oracle/include/linux/ -fpic com_ddv3d_Ddv3dBinding.cpp
  </code></pre>
  
  <p>Creating libddv3djava.so:</p>
  
  <pre><code>~/Programming/intellijprojects/ddv3dbindingstest/src $ g++ -shared -o libddv3djava.so com_ddv3d_Ddv3dBinding.o
  </code></pre>
  
  <p>When I do ldd on libddv3djava.so:</p>
  
  <pre><code>~/Programming/intellijprojects/ddv3dbindingstest/src $ ldd libddv3djava.so         statically linked
  </code></pre>
  
  <h3>Problem:</h3>
  
  <p>It say's libddv3djava.so is <strong>statically linked</strong>. I created libddv3djava.so with <strong>-shared</strong> so this makes me confused.</p>
  
  <h3>Question:</h3>
  
  <p>Why does <strong>ldd</strong> output statically linked, when libddv3djava.so isn't statically linked?</p>
  
  <h3>Additional info:</h3>
  
  <p>I'm not sure if the following is of any relevance, but it could be; libddv3djava.so is dependent on another shared library I created called libddv3d.so. Basically libddv3djava.so is a JNI-wrapper around libddv3d.so. Posting sources:</p>
  
  <p>com_ddv3d_Ddv3dBinding.h:</p>
  
  <pre><code>/* DO NOT EDIT THIS FILE - it is machine generated */
  #include &lt;jni.h&gt;
  /* Header for class com_ddv3d_Ddv3dBinding */
  
  #ifndef _Included_com_ddv3d_Ddv3dBinding
  #define _Included_com_ddv3d_Ddv3dBinding
  #ifdef __cplusplus
  extern "C" {
  #endif
  /*
   * Class:     com_ddv3d_Ddv3dBinding
   * Method:    initialize
   * Signature: ()V
   */
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_initialize
    (JNIEnv *, jobject);
  
  /*
   * Class:     com_ddv3d_Ddv3dBinding
   * Method:    sendDrawableData
   * Signature: (FFFFFFFI)V
   */
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_sendDrawableData
    (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jint);
  
  /*
   * Class:     com_ddv3d_Ddv3dBinding
   * Method:    finished
   * Signature: ()Z
   */
  JNIEXPORT jboolean JNICALL Java_com_ddv3d_Ddv3dBinding_finished
    (JNIEnv *, jobject);
  
  /*
   * Class:     com_ddv3d_Ddv3dBinding
   * Method:    cleanup
   * Signature: ()V
   */
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_cleanup
    (JNIEnv *, jobject);
  
  #ifdef __cplusplus
  }
  #endif
  #endif
  </code></pre>
  
  <p>com_ddv3d_Ddv3dBinding.cpp:</p>
  
  <pre><code>#include &lt;jni.h&gt;
  #include &lt;ddv3d.h&gt;
  #include "com_ddv3d_Ddv3dBinding.h"
  
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_initialize(JNIEnv *env, jobject thisObj)
  {
      ddv3d::initialize();
      return;
  }
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_sendDrawableData(JNIEnv *env, jobject thisObj,
                  jfloat positionX, jfloat positionY, jfloat positionZ,
                  jfloat angle,
                  jfloat rotationAxisX, jfloat rotationAxisY, jfloat rotationAxisZ,
                  jint type)
  {
      ddv3d::sendDrawableData(positionX, positionY, positionZ,
                  angle,
                  rotationAxisX, rotationAxisY, rotationAxisZ,
                  type);
      return;
  }
  JNIEXPORT jboolean JNICALL Java_com_ddv3d_Ddv3dBinding_finished(JNIEnv *env, jobject thisObj)
  {
      return ddv3d::finished();
  }
  JNIEXPORT void JNICALL Java_com_ddv3d_Ddv3dBinding_cleanup(JNIEnv *env, jobject thisObj)
  {
      ddv3d::cleanup();
      return;
  }
  </code></pre>