Skip to content
Advertisement

Error installing r packages (Linux Mint 17.1) “error: C preprocessor “g++ -E” fails sanity check”

I have transfered to a Linux system (previous OSX user) and I am trying to get my R packages installed.

The first issue I ran across was:

JavaScript

but I got around that by launching R using:

JavaScript

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!

But for now, I have an issue that I cannot find a solution to. When I try to install ‘stringi’, I get the following:

JavaScript

What does the line:

JavaScript

refer to? Im fairly certain my C compiler works based on this line:

JavaScript

and this line:

JavaScript

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.

Any and all assistance is greatly appreciated!

Edit: I am using Linux Mint 17.1 (MATE) and R version 3.2.1

Advertisement

Answer

Try installing g++: sudo apt-get install g++

The GNU C Compiler (GCC) may be installed, but g++ isn’t always installed by default.

As for having to sudo into R Studio, that’s the equivalent of having to type your password in when installing a program in OS X – it’s just one of the little intricacies of Linux systems (incidentally, OS X is based on BSD Linux). I imagine you won’t necessarily need to use sudo when you’re not installing a package though (not sure, haven’t really used R Studio to be honest).

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement