Rstudio无法安装软件包devtools:gcc错误

时间:2018-08-11 11:04:00

标签: gcc installation rstudio devtools

我想安装软件包devtools。但是,在成功下载所有依赖项之后,安装表单时会出错:

trait Coffee {
  def cost: Double
  def ingredients: String
}

//abstract class CoffeeDecorator(decoratedCoffee: Coffee) extends Coffee {
//  val sep = ", "
//
//  override def cost = decoratedCoffee.cost
//  override def ingredients = decoratedCoffee.ingredients
//}

class Milk(decoratedCoffee: Coffee) extends Coffee {
  override def cost = decoratedCoffee.cost + 0.5
  override def ingredients = decoratedCoffee.ingredients + "," + "Milk"
}

class Whip(decoratedCoffee: Coffee) extends Coffee {
  override def cost = decoratedCoffee.cost + 0.7
  override def ingredients = decoratedCoffee.ingredients + "," + "Whip"
}


object DecoratorSample {... // same as the comparing source code.

我已检查gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rawmatch.c -o rawmatch.o gcc: error: unrecognized command line option ‘-fstack-protector-strong’ gcc: error: unrecognized command line option ‘-Wdate-time’ /usr/lib/R/etc/Makeconf:159: recipe for target 'rawmatch.o' failed make: *** [rawmatch.o] Error 1 ERROR: compilation failed for package ‘mime’ * removing ‘/usr/local/lib/R/site-library/mime’ 。我可以从终端运行示例C程序文件。

1 个答案:

答案 0 :(得分:0)

似乎您需要使用最新的gcc版本,至少是4.9。

gcc 4.9(release notes)中引入了-fstack-protector-strong-Wdate-time这两个无法识别的选项。