I have the exact same error as here: Rstudio does not display correct C++ diagnostics; libclang error
I have the same problem on two totally separate machines (one Windows and one macOS) using the latest stable versions of RStudio, R, and Rcpp. The diagnostics claim that the objects are integers when they are actually, for example, of class Rcpp::NumericVector.
I would think that lots of others would be having this same error as well? Has anyone else experienced this issue? Does anyone have any ideas for how to address it?
Has anyone else had this issue?
We're tracking these issues here:
opened 04:57PM - 22 Apr 19 UTC
closed 04:31PM - 29 Nov 22 UTC
bug
autocompletion
c++
package dev
### System details
RStudio Edition : Desktop [Open Source]
RStudio V… ersion : 1.2.1335
OS Version : Windows 10 x64 (build 17763)
R Version : R version 3.5.3 Patched (2019-03-11 r76275)
### Steps to reproduce the problem
Create an R project that doesn't use C++ / Rcpp, create a new C++ file, and then save that outside of the project directory. Ensure it has the contents:
```
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericVector test(NumericVector x) {
x.
}
```
Try e.g. requesting autocompletion results after `x.`.
### Describe the problem in detail
Diagnostics + autocompletion features fail to work.
### Describe the behavior you expected
These features should work without issue.
### Notes
The issue appears to arise because we use the DESCRIPTION's `LinkingTo` entry to figure out what packages should be used when searching for headers, but when that entry is blank / missing we don't look for e.g. `Rcpp`.
opened 07:28AM - 26 Mar 19 UTC
closed 10:09PM - 02 Dec 19 UTC
bug
I often edit C++ source files using Rcpp in RStudio Server. However, the autocom… plete usually does not work, i.e. the completion list never appears. I check the autocompletion settings and everything looks normal. I'm not sure if there's a way I can figure out why autocomplete does not work.
### System details
RStudio Edition : Server
RStudio Version : 1.3.74
OS Version : Ubuntu 18.04
R Version : 3.5.2
opened 06:43PM - 05 Nov 18 UTC
closed 12:37AM - 08 Nov 18 UTC
bug
### System details
RStudio Edition : Desktop
RStudio Version : RStud… io v1.2.1090
OS Version : macOS 10.14.1
R Version : 3.5.1
### Steps to reproduce the problem
Without the [macOS SDK Headers](https://forums.developer.apple.com/thread/104296) installed, try opening an R package using C++ code (e.g. https://github.com/rstudio/rstudio/issues/3777) and try to work with a C++ file.
### Describe the problem in detail
Some editor features don't work (e.g. autocompletion + diagnostics).
### Describe the behavior you expected
Editor features should work without issue.
### Notes
If we see the user is running on macOS Mojave, we should warn or prompt the user to install macOS SDK headers. Basically, if we detect that `/usr/include` does not exist, we would prompt the user to try and install the headers. This can be done with e.g.
``` sh
installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
```
Having the same issue (Windows 10). It's still compiling but I'm having to ignore incorrect diagnostic errors. Any news on a fix?
system
Closed
June 21, 2019, 11:34am
5
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.