title: C++ (gcc/g++) Two huge arrays of strings take extremely long to compile
body: <p>For a program written in C++, I need two huge arrays of strings that contain data.</p>
  
  <p>They are defined in a header file as follows:</p>
  
  <pre><code>#include &lt;string&gt;
  static const string strdataA[30000]={"this is the first line of the data",
      "the second line of data",
      "other stuff in the third line",
  </code></pre>
  
  <p>down to</p>
  
  <pre><code>    "last line."};
  //second array strings
  static const string strdataB[60000]={"this is the first line of the data",
      "the second line of data",
      "other stuff in the third line",
  </code></pre>
  
  <p>down to</p>
  
  <pre><code>    "last line."};
  </code></pre>
  
  <p>But when I compile this with g++, it takes so long that I have not seen it complete. It also uses about two GB of virtual memory. So I commented out strdataB[], and then the program did compile, but still after a long while. The executable was only about 8 Mb and worked fine.</p>
  
  <p>What can I do in order to speed up the compiling process? I don't mind if I have to change the code, but I don't want to use an external file to load from. I would like an array because it works extremely well for me inside the program.</p>
  
  <p>I read on the net somewhere that "static const" should do the trick, but I learned by experience that it doesn't.</p>
  
  <p>Thanks a lot in advance for any suggestions!</p>