Hi Raffaele,
Thanks for the message.
This looks like a system configuration issue, and it is hard for us to diagnose those. I notice that the R version referenced in the paths of your output is 4.3 (over a year old) and the gcc (g++) version is 11.4.0. I am not an expert on versions of gcc but on my Windows setup used for some package testing, the gcc version (from "system('g++ --version')") is 13.2.0. Sometimes when people get stuck like this, they find success in reinstalling freshly and in order, R, Rtools (making sure to get the version that matches your version of R), and nimble. Have you tried that?
Another less likely possibility is if you have a Makevars file that is being used instead of the one(s) nimble tries to put in place. (Makevars provides C++ compiler flags, for example.)
FWIW, the offending C++ code is in the CppAD package, which is included with nimble. So it is not code we wrote but we do need to ensure it works. I believe there have been changes in recent R versions in default C++ standard, so I can't rule out that on some system this could give an unforeseen problem, but given that your output appears to show an older version of R, I am guessing that is the place to start.
Please let us know if any of this helps. The nimble core team has a variety of travel these days so we may be slow to respond. Other users on this list have sometimes saved the day on configuration issues, so please chime in!
HTH
Perry