title: Error: ‘void*’ is not a pointer-to-object type error while dynamically opening multiple shared libraries
body: <p>I need to open multiple shared libraries at run time. I don't know their number(count), so I am using dynamic memory allocation:</p>
  
  <pre><code>void* handle= new void* [n]; // n refers to number of handles
  handle[0] = dlopen("./fileN.so", RTLD_LAZY); // doesn't work : Error: ‘void*’ is not a pointer-to-object type
  </code></pre>
  
  <p>However if I do static allocation, it works- </p>
  
  <pre><code>void* handle[10];
  handle[0] = dlopen("./file0.so", RTLD_LAZY); // works
  </code></pre>
  
  <p>Why is that when I am dynamically accessing the handle, I am getting error? and how do I fix it? </p>