# G++ not found

**URL:** <https://discourse.mc-stan.org/t/g-not-found/19686>\
**Category:** RStan\
**Tags:** rstan\
**Created:** [December 7, 2020, 10:34pm UTC](https://discourse.mc-stan.org/t/g-not-found/19686 "2020-12-07T22:34:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon38878713](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@anon38878713](https://discourse.mc-stan.org/u/anon38878713)\
**Post date:** [December 7, 2020, 10:34pm UTC](https://discourse.mc-stan.org/t/g-not-found/19686/1 "2020-12-07T22:34:07Z")

</div>

I am unable to run any ulam() code, or even the following:

```
    schools_dat <- list(J = 8, 
                         y = c(28, 8, -3, 7, -1, 1, 18, 12),
                         sigma = c(15, 10, 16, 11, 9, 11, 10, 18))
    fit <- rstan::stan(file = 'schools.stan', data = "schools_dat")

```

The message I get is:

```
'C:/rtools40/usr/mingw_/bin/g++' not found

```

But I see g++ sitting right here:

C:\rtools40\mingw64\bin

So this seems like a path problem. I believe the solution is to change the path in the Makevars file, but I have no idea how to do that. I would appreciate step-by-step instructions on that solution, or suggestions on other possible solutions.

I’m using:

Windows 10  
R 4.0.3  
RTools40

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Post date:** [December 8, 2020, 12:17am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/2 "2020-12-08T00:17:20Z")

</div>

Hi @anon38878713, welcome to the Stan forums and sorry you’re running into trouble getting Stan running. I’m not great with Windows personally, but have you seen these instructions yet? [https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows). If you have R 4.0.3 then the stuff in the section for R 4.0 would apply.

If you’ve already gone through those instructions (like the steps for checking BINPREF) and it still isn’t working then hopefully one of my Windows literate colleagues like @andrjohns or @bgoodri will be able to help you get this fixed.

---

<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:** [December 8, 2020, 12:32am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/4 "2020-12-08T00:32:21Z")

</div>

That warning is harmless and does not affect sampling in any way. Does the model sample and then give that warning or is there no sampling at all (i.e., no `fit` object in the workspace)?

---

<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:** [December 8, 2020, 12:36am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/6 "2020-12-08T00:36:46Z")

</div>

Can you run the model with `verbose=T` and post the output?

---

<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:** [December 8, 2020, 12:45am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/8 "2020-12-08T00:45:19Z")

</div>

Ah there’s the error, it looks like a data issue not a c++ issue.

What happens when you run:

```
example(stan_model, package="rstan", run.dontrun=T)

```

?

---

<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:** [December 8, 2020, 12:50am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/10 "2020-12-08T00:50:39Z")

</div>

Oh I believe the issue is that you’re specifying the data with quotations:

```
data = "schools_dat"

```

So it’s trying to pass a string as data. Can you try running the model without quotations around the data list?

---

<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:** [December 8, 2020, 12:56am UTC](https://discourse.mc-stan.org/t/g-not-found/19686/13 "2020-12-08T00:56:31Z")

</div>

Nope the warning is safe to ignore, its just a misconfiguration on the back end that will be fixed in the next release
