0

Trying to install rgdal package in R 3.3.0 on Ubuntu 16.04 using install.packages("rgdal") and getting the following error:

In file included from /usr/local/lib/R/site-library/sp/include/sp.h:13:0, from rgdal.h:15, from OGR_write.cpp:11: /usr/share/R/include/S.h:41:3: error: #error S.h can not be used from C++ code: use R.h instead # error S.h can not be used from C++ code: use R.h instead

anyone else seen this and know how to fix it? Or do we need to wait for a fix to the rgdal package itself?

Psidom
  • 209,562
  • 33
  • 339
  • 356
Dave Kincaid
  • 3,970
  • 3
  • 24
  • 32
  • 1
    Just tried now and it worked, although I'm under Ubuntu 14.04. Maybe try to reinstall `sp` also before `rgdal`? Just a try, no great expectations. – nicola May 18 '16 at 14:59
  • 1
    That did the trick! Reinstalled sp package and rgdal installed cleanly afterward. If you want to put this into an answer, I'll mark it as the answer. Thanks! – Dave Kincaid May 18 '16 at 15:01

1 Answers1

5

Wild guess: you could try to reinstall sp before, just to have any dependency up-to-date.

nicola
  • 24,005
  • 3
  • 35
  • 56