title: Error installing r packages (Linux Mint 17.1) "error: C preprocessor "g++ -E" fails sanity check"
body: <p>I have transfered to a Linux system (previous OSX user) and I am trying to get my R packages installed. </p>
  
  <p>The first issue I ran across was:</p>
  
  <pre><code>Warning in install.packages("stringi") :
    'lib = "/usr/local/lib/R/site-library"' is not writable
  Would you like to use a personal library instead?  (y/n)
  </code></pre>
  
  <p>but I got around that by launching R using:</p>
  
  <pre><code>$ sudo R
  </code></pre>
  
  <p>If someone has a more permanent solution to using 'sudo' (because I will be using RStudio in the future), I would be interested to know!</p>
  
  <p>But for now, I have an issue that I cannot find a solution to. When I try to install 'stringi', I get the following: </p>
  
  <pre><code>* installing *source* package ‘stringi’ ...
  ** package ‘stringi’ successfully unpacked and MD5 sums checked
  checking for local ICUDT_DIR... icu55/data
  checking for R_HOME... /usr/lib/R
  checking for R... /usr/lib/R/bin/R
  checking for R &gt;= 3.1.0... yes
  checking for cat... /bin/cat
  checking for gcc... gcc -std=gnu99
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables... 
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc -std=gnu99 accepts -g... yes
  checking for gcc -std=gnu99 option to accept ISO C89... none needed
  checking how to run the C preprocessor... g++ -E
  configure: error: in `/tmp/Rtmplf58Ya/R.INSTALL2d1959f5fc41/stringi':
  configure: error: C preprocessor "g++ -E" fails sanity check
  See `config.log' for more details
  ERROR: configuration failed for package ‘stringi’
  * removing ‘/usr/local/lib/R/site-library/stringi’
  </code></pre>
  
  <p>What does the line:</p>
  
  <pre><code>configure: error: C preprocessor "g++ -E" fails sanity check
  </code></pre>
  
  <p>refer to? Im fairly certain my C compiler works based on this line:</p>
  
  <pre><code>checking whether the C compiler works... yes
  </code></pre>
  
  <p>and this line:</p>
  
  <pre><code>checking whether we are using the GNU C compiler... yes
  </code></pre>
  
  <p>but like I said, I am just now starting to delve into the inner workings of the Linux system, so I could be totally wrong here. </p>
  
  <p>Any and all assistance is greatly appreciated!</p>
  
  <p>Edit: I am using Linux Mint 17.1 (MATE) and R version 3.2.1</p>