title: how to call function in executable from my library?
body: <p>I have an executable and a dynamic library (.so). The library exports some symbols and executable calls it successfully. But I want to make possible to library call executable's functions. I've tried to do following in executable:</p>
  
  <pre><code>//test
  extern "C" void print(const char * str) {
      std::cout &lt;&lt; str &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>and this in library:</p>
  
  <pre><code>extern "C" void print(const char *);
  </code></pre>
  
  <p>but when i call <code>dlopen</code> in executable (to load the library) it returns error <code>undefined symbol: print</code>. how can i fix it? </p>