title: Is there an elegant way to avoid dlsym when using dlopen in C?
body: <p>I need to dynamically open a shared library <code>lib.so</code> if a specific condition is met at runtime. The library contains ~700 functions and I need to load all their symbols.</p>
  
  <p>A simple solution is to define the function pointers to all symbols contained in <code>lib.so</code>, load the library using <code>dlopen</code> and finally get the addresses of all symbols using <code>dlsym</code>. However, given the number of functions, the code implementing this solution is very cumbersome.</p>
  
  <p>I was wondering if a more elegant and concise solution exists, maybe with an appropriate use of macros for defining the function pointers. Thanks!</p>