Greetings: I've tried upgrading to RStudio 1.2 a couple of times, just now with 1.2.5001. On both occasions, Rcpp diagnostics stop working (see screenshot linked below). When I revert to RStudio 1.1, everything's fine again.
From googlings, nobody else appears to be having the same problem which makes me suspect it's something on my machine. I'm not a C++ expert (Java / R is my usual thing) but it's looking like it's not loading the Rcpp namespace (the diagnostic problems are with e.g. NumericVector, Rcout etc). I've updated everything else (R and Rcpp), still no joy.
Is anyone else having the same difficulty / has any thoughts on a fix? For now, back to 1.1....!
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir:
ignoring nonexistent directory "lib\clang\5.0.2\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" #include "..." search starts here: #include <...> search starts here:
C:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2
C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2
C:/PROGRA~1/R/R-36~1.1/include
C:/Users/admin/Dropbox/RPackages/Rcpp/include
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM
End of search list.
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:8:46: error: call to 'floor' is ambiguous
C:/Program Files\RStudio\resources\libclang\builtin-headers\libc++\5.0.2\math.h:866:46: note: candidate function
C:/Program Files\RStudio\resources\libclang\builtin-headers\libc++\5.0.2\math.h:867:46: note: candidate function
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:16:24: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:16:35: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:3: error: use of undeclared identifier 'Rcout'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:18: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:33: error: use of undeclared identifier 'RAND_MAX'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:40:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:41:17: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:45:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:46:17: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:52:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:57:25: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:57:42: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:89:3: error: use of undeclared identifier 'Rcout'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:105:10: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:117:23: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:117:44: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:118:23: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:118:44: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
fatal error: too many errors emitted, stopping now [-ferror-limit=]
TOTAL MEMORY: 54 mb (simfunctions.cpp)
PERFORMANCE 794 ms (simfunctions.cpp)
CLANG INDEXING: C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp
CLANG REMOVE INDEX: C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp
(Creating new index)
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir:
ignoring nonexistent directory "lib\clang\5.0.2\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" #include "..." search starts here: #include <...> search starts here:
C:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2
C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2
C:/PROGRA~1/R/R-36~1.1/include
C:/Users/admin/Dropbox/RPackages/Rcpp/include
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM
End of search list.
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:8:46: error: call to 'floor' is ambiguous
C:/Program Files\RStudio\resources\libclang\builtin-headers\libc++\5.0.2\math.h:866:46: note: candidate function
C:/Program Files\RStudio\resources\libclang\builtin-headers\libc++\5.0.2\math.h:867:46: note: candidate function
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:16:24: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:16:35: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:3: error: use of undeclared identifier 'Rcout'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:18: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:30:33: error: use of undeclared identifier 'RAND_MAX'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:40:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:41:17: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:45:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:46:17: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:52:26: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:57:25: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:57:42: error: subscripted value is not an array, pointer, or vector
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:89:3: error: use of undeclared identifier 'Rcout'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:105:10: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:117:23: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:117:44: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:118:23: error: use of undeclared identifier 'rand'
C:/Users/admin/Dropbox/SheffieldMethodsInstitute/SocialFrontiers/SIM/simfunctions.cpp:118:44: error: member reference base type 'Rcpp::NumericVector' (aka 'int') is not a structure or union
fatal error: too many errors emitted, stopping now [-ferror-limit=]
TOTAL MEMORY: 54 mb (simfunctions.cpp)
PERFORMANCE 864 ms (simfunctions.cpp)
p.s. I get that output when I save the cpp file, not source it...? It will source/compile fine, by the way. The errors it's suggesting are there on save don't cause actual compile problems.
Hi Kevin - Rtools is in the root folder, just at C:
I've currently gone back to 1.1. With the same Rtools in the same location, same everything else, C++ diagnostics work fine.
1.2 was doing a few other things that made me switch back too (doesn't work with copy/pasting file paths from copying files in explore, was doing an odd run-whole-script thing when attempting to run a single line, but only randomly. Both problems not present in 1.1.)
Guess I'll try 1.2 again in a few months, see if anything has changed?