title: Resolve undefined symbol for shared libraries
body: <p>In a C-program, I want to add specific modules as shared-libraries using <code>dlopen</code>.</p>
  
  <p>Using <code>dlopen</code> with  <code>RTLD_LAZY</code> (using <code>RTLD_NOW</code> directly fails probably due to the reason below) and <code>dlsym</code> I can create the handle to the actual function that I want to call. After calling the function, I get the error</p>
  
  <pre><code>program: symbol lookup error: file.so: undefined symbol: createExpressionNumber
  </code></pre>
  
  <p>The function <code>createExpressionNumber</code> is a function of the program. The shared library is compiled by</p>
  
  <pre><code>gcc -fPIC -c ...
  </code></pre>
  
  <p>and linked by</p>
  
  <pre><code>gcc -shared ...
  </code></pre>
  
  <p>It seems, that symbols are not resolved when linking as shared lib (which makes sense) but that the symbols are not provided by my program when opening the lib.</p>
  
  <p>Is there any way to provide the functions of my program to the loaded shared lib or do I need to extract all functions from my program that are used by the shared lib as seperate shared lib?</p>