title: Proper use libdl and dynamically linked libraries
body: <p>I need to dynamically link a library that I have created.  I'm not exactly sure what the issue is.  It all compiles properly, but I always catch <code>handle</code> as the <code>NULL</code> pointer:</p>
  
  <pre><code>void *handle;
  char *error;
  handle = dlopen ("./hw11-lib-michaelSchilling.so", RTLD_LAZY);
  //same error comes up with full path as well as './hw11...'
  if(!handle){
      error = dlerror();
      printf("%s\n", error);
      printf("Error loading library.\n");
      exit(1);
  }
  </code></pre>
  
  <p>I cant get passed this error and I'm not sure what could possibly be wrong. I'm pretty sure I've compiled everything correctly.  Here are the compilation steps I used:</p>
  
  <pre><code>gcc -rdynamic -c hw11-lib-michaelSchilling.c -o hw11-lib-michaelSchilling.so
  gcc hw11-michaelSchilling-4.c -ldl -o hw11-michaelSchilling-4
  </code></pre>
  
  <p>I'm getting an error that reads</p>
  
  <blockquote>
    <p>only ET_DYN and ET_EXEC can be loaded.</p>
  </blockquote>