# Cannot install Rstan for R 3.6.3

**URL:** <https://discourse.mc-stan.org/t/cannot-install-rstan-for-r-3-6-3/30027>\
**Category:** General\
**Tags:** installation, rstan\
**Created:** [January 11, 2023, 11:47pm UTC](https://discourse.mc-stan.org/t/cannot-install-rstan-for-r-3-6-3/30027 "2023-01-11T23:47:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BThomas](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@BThomas](https://discourse.mc-stan.org/u/BThomas)\
**Post date:** [January 11, 2023, 11:47pm UTC](https://discourse.mc-stan.org/t/cannot-install-rstan-for-r-3-6-3/30027/1 "2023-01-11T23:47:14Z")

</div>

I am running into issues trying to install Rstan for R 3.6.3 and have scoured the forums but none of the proposed solutions are working for me.

System Info: Windows 11 Home  
R: 3.6.3  
Rstudio 2022.07.1  
RTools 3.5

I followed the instructions in

> **[Configuring C Toolchain for Windows · stan-dev/rstan Wiki](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows#r-36)**
>
> RStan, the R interface to Stan. Contribute to stan-dev/rstan development by creating an account on GitHub.

and everything works fine.

Here is the output of some commands I have seen on the forums:

```plaintext
> readLines("~/.Renviron")
[1] "PATH=\"C:/Rtools/bin;${PATH}\""
> readLines("~/.Rprofile")
[1] "Sys.setenv(BINPREF = \"C:/Rtools/mingw_$(WIN)/bin/\")"
> readLines("~/.R/Makevars.win")
[1] "" " CXX14FLAGS += -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2"
> Sys.getenv("PATH")
[1] "C:/Rtools/bin;C:\\Program Files\\R\\R-3.6.3\\bin\\x64;C:\\Program Files (x86)\\Razer\\ChromaBroadcast\\bin;C:\\Program Files\\Razer\\ChromaBroadcast\\bin;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\dotnet\\;C:\\Program Files\\Git\\cmd;C:\\windows\\system32\\config\\systemprofile\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\rjtho\\go\\bin;C:\\Users\\rjtho\\scoop\\shims;C:\\Users\\rjtho\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\rjtho\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:/Program Files/RStudio/bin/quarto/bin"

```

When I follow the getting started instructions found

> **[RStan Getting Started · stan-dev/rstan Wiki](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started)**
>
> RStan, the R interface to Stan. Contribute to stan-dev/rstan development by creating an account on GitHub.

I end up getting the error

```plaintext
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined

```

I have seen this error come up in other places on the forums, and have tried out many of the changes to makevars suggested, but none of those work.

Any help is appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![BThomas](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@BThomas](https://discourse.mc-stan.org/u/BThomas)\
**Post date:** [January 12, 2023, 5:06pm UTC](https://discourse.mc-stan.org/t/cannot-install-rstan-for-r-3-6-3/30027/2 "2023-01-12T17:06:29Z")

</div>

I was able to get around this issue by getting our IT unit to install both R 4.2.2 and 3.6.3 on our devices and when I use 4.2.2 and corresponding version of Rtools it works fine (need to keep 3.6.3 around for connecting with our DB through ROracle). So this isn’t an ‘urgent’ problem that needs to be solved.  
But would still be great to understand what is causing this issue for people on my team who don’t routinely need to run models or don’t want to manage bouncing between 2 versions of R.  
Happy to delete this post though if we want to consider this solved.
