title: how to work with an .so file without running it at the command line g++
body: <p>I've created a .so file called car.so. I would like to test and work with this library in a test.cc code . In the command line i would like to compile: g++ test.cc -o test. I don't want to also link (include) the library car.so. </p>
  
  <p>How to do that?</p>
  
  <p>My test.cc code looks like this:</p>
  
  <pre><code>void* handle = dlopen("/home/v3/car.so", RTLD_LAZY);
  
    Car* (*create)();
    void (*destroy)(Car*);
  
    create = (Car* (*)())dlsym(handle, "create_object");
    destroy = (void (*)(Car*))dlsym(handle, "destroy_object");
  
    Car* carr = (Car*)create();
    carr-&gt;brake();
    destroy( carr );
  </code></pre>
  
  <p>I would also like to ask if it's possible to include 3 .so file in a single .so file. </p>
  
  <p>edit:</p>
  
  <p>I am working on Ubuntu/Linux</p>