title: C++ conditional include file runtime
body: <p>I am working on a game that is coded in C++ and I would like to make it possible to change language at runtime. Currently, the language is chosen at compile time by including a header file (which has language definitions), like so:</p>
  
  <pre><code>#include "lan_eng.h"
  </code></pre>
  
  <p>Therefore, the game does not allow the language to be changed once the client has been compiled. My question is if there is a way in which I can include files conditionally at runtime? I am new to C++, so at first I was thinking that I could do something like this:</p>
  
  <pre><code>#define DEF_LANGUAGE_ENG
  //#define DEF_LANGUAGE_DEN
  
  #ifdef DEF_LANGUAGE_ENG
  
      #include "lan_eng.h"
  
  #endif
  
  #ifdef DEF_LANGUAGE_DEN
  
      #include "lan_den.h"
  
  #endif
  </code></pre>
  
  <p>Sure that makes it easier to maintain, but the problem is that I believe it only works at compile time. I would like to be able to store the chosen language in a variable (which is changed at runtime) and then use that variable to choose which header file to include. Is there a way to do this with header files, or would I be forced to make a class?</p>
  
  <p>I hope it is not a stupid question; my searches did not give me the results I was hoping for.</p>
  
  <p>Thanks in advance!</p>