Collect2.exe: error: ld returned 1 exit status on Windows 10, R 4.0.2

No thanks, Andrew. I do appreciate the offer though.

I think I might have found a solution this problem, again serendipitously. Turns out the ./etc/x64/Makeconf file of Microsoft R Open has a few differences with that of the standard R distribution. After checking them one-by-one, rstan starts working in my computer if I change

LOCAL_SOFT ?= C:/a/w/1/s/vendor/extsoft

to

LOCAL_SOFT ?=

As you can imagine I don’t know why, but seems to do the trick and hasn’t broken anything else (fingers crossed). @billdoepp I don’t know if this is still a relevant issue for you but if you want to try this fix hopefully it’ll work for you as well!

It seems now is finally time to go back to my brms models… :)

1 Like

Thanks @Pintaius. Your solution works! I do get an R warning message after compiling the Stan model, but it runs as expected.

The warning messages is:

Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘C:/rtools40/usr/mingw_/bin/g++’ not found

Thanks again for the solution!!!

1 Like