# Modeling failed Warnings: 'C:/Users/R-34~1.3/rtools40/usr/mingw\_/bin/g++' not found Errors: Multiple results for CXX14FLAGS found, something is wrong.FALSE

**URL:** <https://discourse.mc-stan.org/t/modeling-failed-warnings-c-users-r-34-1-3-rtools40-usr-mingw-bin-g-not-found-errors-multiple-results-for-cxx14flags-found-something-is-wrong-false/19154>\
**Category:** RStan\
**Tags:** installation, rstan\
**Created:** [November 8, 2020, 11:54pm UTC](https://discourse.mc-stan.org/t/modeling-failed-warnings-c-users-r-34-1-3-rtools40-usr-mingw-bin-g-not-found-errors-multiple-results-for-cxx14flags-found-something-is-wrong-false/19154 "2020-11-08T23:54:50Z")\
**Posts on this page:** 1\
**Showing post:** 54

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [November 11, 2020, 2:22am UTC](https://discourse.mc-stan.org/t/modeling-failed-warnings-c-users-r-34-1-3-rtools40-usr-mingw-bin-g-not-found-errors-multiple-results-for-cxx14flags-found-something-is-wrong-false/19154/54 "2020-11-11T02:22:35Z")

</div>

Alright, let’s try moving the entire package installation directory to your local drive (i.e., all R packages will get installed to a folder on your computer, rather than the network drive).

First we need to remove those RStan and StanHeaders packages:

```
remove.packages(c("rstan","StanHeaders"))

```

And restart R.

Given that we know you have permissions to the `C:/Users/R` folder, we’ll create a folder there which your packages will be installed into:

```
dir.create("C:/Users/R/win-library/4.0", recursive = T)

```

Next, we need to tell R to install and load R packages from this directory. We can do this by setting the `R_LIBS_USER` environment variable using your `.Renviron` file:

```
cat("R_LIBS_USER = \"C:/Users/R/win-library/4.0\"",
    file="~/.Renviron", append=TRUE)

```

And then restart R. If you look at the ‘Packages’ pane in RStudio, you should only see packages listed under ‘System Library’. Next, we’ll copy R packages from your old directory to this new one (otherwise you’ll have to re-install them all):

```
file.copy(from="~/R/win-library/4.0/",to="C:/Users/R/win-library/",recursive = T)

```

Depending on how many packages you have installed, this could take a few minutes. Then restart R again.

If all of the above ran without any errors (fingers crossed), then try to install RStan and run the example model again:

```
install.packages("rstan")
library(rstan)
example(stan_model, run.dontrun=T)

```

---

_[View the full topic](https://discourse.mc-stan.org/t/modeling-failed-warnings-c-users-r-34-1-3-rtools40-usr-mingw-bin-g-not-found-errors-multiple-results-for-cxx14flags-found-something-is-wrong-false/19154)._
