title: Using a C #define variable as an #include
body: <p>I have the following code which includes a library based on a #define'd variable:</p>
  
  <pre><code>#if LIB_SELECTOR==1
  #include "path/to/lib1.h"
  #else
  #include "path/to/lib2.h"
  #endif
  </code></pre>
  
  <p>However, this library needs to be included in a number of source files, and maintaining this conditional across all of them could be problematic and prone to error.  Ideally, I would simply do something like:</p>
  
  <pre><code>#if LIB_SELECTOR==1
  #define DYNAMIC_LIB "path/to/lib1.h"
  #else
  #define DYNAMIC_LIB "path/to/lib2.h"
  #endif
  </code></pre>
  
  <p>Then, in all of the requisite source files, simply use</p>
  
  <pre><code>#include DYNAMIC_LIB
  </code></pre>
  
  <p>I've tried it in my code, and received the error <code>error: #include expects "FILENAME" or &lt;FILENAME&gt;</code>. This doesn't give me much hope, but I am wondering what the proper way to solve this problem is.</p>