H:/rtools40/usr/mingw_/bin/g++ not found

Hello,
I did as you suggested.
The devtool is installed and attached is the output after calling
devtools::session_info(“rstan”)

I tried running my code again and still same error message

Can you run devtools::session_info("rstan") in the console, not from markdown? I need to see the list of packages and their versions

devtools::session_info(“rstan”)

  • Session info ---------------------------------------------------------------------------------------------------
    setting value
    version R version 4.0.2 (2020-06-22)
    os Windows 10 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate English_United Kingdom.1252
    ctype English_United Kingdom.1252
    tz Europe/London
    date 2020-09-11

  • Packages -------------------------------------------------------------------------------------------------------
    ! package * version date lib source
    assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2)
    backports 1.1.8 2020-06-17 [1] CRAN (R 4.0.2)
    BH 1.72.0-3 2020-01-08 [1] CRAN (R 4.0.0)
    callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.2)
    checkmate 2.0.0 2020-02-06 [1] CRAN (R 4.0.2)
    cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.2)
    colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.2)
    crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.2)
    curl 4.3 2019-12-02 [1] CRAN (R 4.0.2)
    desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.2)
    digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.2)
    ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.2)
    evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.2)
    fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.2)
    farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.2)
    ggplot2 3.3.2 2020-06-19 [1] CRAN (R 4.0.2)
    glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.2)
    gridExtra 2.3 2017-09-09 [1] CRAN (R 4.0.2)
    gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.2)
    inline 0.3.15 2018-05-18 [1] CRAN (R 4.0.2)
    isoband 0.2.2 2020-06-20 [1] CRAN (R 4.0.2)
    jsonlite 1.7.0 2020-06-25 [1] CRAN (R 4.0.2)
    labeling 0.3 2014-08-23 [1] CRAN (R 4.0.0)
    lattice 0.20-41 2020-04-02 [2] CRAN (R 4.0.2)
    lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.2)
    loo 2.3.1 2020-07-14 [1] CRAN (R 4.0.2)
    magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.2)
    MASS 7.3-51.6 2020-04-26 [2] CRAN (R 4.0.2)
    Matrix 1.2-18 2019-11-27 [2] CRAN (R 4.0.2)
    matrixStats 0.56.0 2020-03-13 [1] CRAN (R 4.0.2)
    mgcv 1.8-31 2019-11-09 [2] CRAN (R 4.0.2)
    munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.2)
    nlme 3.1-148 2020-05-24 [2] CRAN (R 4.0.2)
    pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2)
    pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2)
    pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2)
    pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.2)
    praise 1.0.0 2015-08-11 [1] CRAN (R 4.0.2)
    prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2)
    processx 3.4.3 2020-07-05 [1] CRAN (R 4.0.2)
    ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.2)
    R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.2)
    RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 4.0.0)
    Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.2)
    RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 4.0.2)
    D RcppParallel 5.0.2 2020-06-24 [1] CRAN (R 4.0.2)
    rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.2)
    rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.2)
    rstan 2.21.2 2020-07-27 [1] CRAN (R 4.0.2)
    rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.2)
    scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.2)
    StanHeaders 2.21.0-5 2020-06-09 [1] CRAN (R 4.0.2)
    testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.2)
    tibble 3.0.3 2020-07-10 [1] CRAN (R 4.0.2)
    utf8 1.1.4 2018-05-24 [1] CRAN (R 4.0.2)
    V8 3.2.0 2020-06-19 [1] CRAN (R 4.0.2)
    vctrs 0.3.1 2020-06-05 [1] CRAN (R 4.0.2)
    viridisLite 0.3.0 2018-02-01 [1] CRAN (R 4.0.2)
    withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.2)

[1] H:/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.2/library

D – DLL MD5 mismatch, broken installation.

I sent the print screen as the other one seems to be so muddled up.

Thanks so much

Thanks! Can you try:

install.packages("inline", type = "source")

And then try your model again?

just did that now and still model not compiling:
Here is the output from console:
‘H:/rtools40/usr/mingw_/bin/g++’ not foundincomplete final line found on 'H://.R/Makevars.win’incomplete final line found on 'H://.R/Makevars.win’running command ‘C:/PROGRA~1/R/R-40~1.2/bin/x64/R CMD SHLIB file303c3cd27327.cpp 2> file303c3cd27327.cpp.err.txt’ had status 1cannot open file ‘file303c3cd27327.cpp.err.txt’: No such file or directoryError in file(con, “r”) : cannot open the connection
Error in sink(type = “output”) : invalid connection

What do you get from:

packageVersion("inline")

Hello andrjohns,
Sorry for delayed communication. I had some internet issue.
I got to run the code today on RStan however attached is the response .
I could not retrieve the answers
What can i do?
Thank you in advance

It looks like there’s a problem with your matrixStats R package. Can you try reinstalling it?

Hello andrJohn,
Please, I haven’t resolve my issue with rstan yet.
Below is the error message

Error in compileCode(f, code, language = language, verbose = verbose) :
sh: H:/Rtools/mingw_64/bin/g++: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:229: file3bc03aed1c88.o] Error 127
Error in sink(type = “output”) : invalid connection

Can you post the outputs from:

Sys.getenv("PATH")
Sys.getenv("BINPREF")
readLines("~/.R/Makevars.win")
readLines("~/.Rprofile")
readLines("~/.Renviron")

Sys.getenv(“PATH”)
[1] “C:\rtools40\usr\bin;C:\Program Files\R\R-4.0.2\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\WINDOWS\System32\OpenSSH\;C:\Users\b7023023\AppData\Local\Microsoft\WindowsApps;”
Sys.getenv(“BINPREF”)
[1] “H:/Rtools/mingw_(WIN)/bin/" readLines("~/.R/Makevars.win") [1] "CXX14FLAGS=-O3 -mtune=native -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2" readLines("~/.Rprofile") [1] "Sys.setenv(BINPREF = \"H:/Rtools/mingw_(WIN)/bin/")”
[2] “Sys.setenv(BINPREF = "H:/Rtools/mingw_(WIN)/bin/\")" readLines("~/.Renviron") [1] "PATH=\"{RTOOLS40_HOME}\usr\bin;${PATH}"”

Sorry, can you separate the output by which command it came from? Just so I know which files need to be changed and how

Sys.getenv(“PATH”)
[1] “C:\rtools40\usr\bin;C:\Program Files\R\R-4.0.2\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\WINDOWS\System32\OpenSSH\;C:\Users\b7023023\AppData\Local\Microsoft\WindowsApps;”

Sys.getenv(“BINPREF”)
[1] “H:/Rtools/mingw_$(WIN)/bin/”

readLines(“~/.R/Makevars.win”)
[1] “CXX14FLAGS=-O3 -mtune=native -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2”