One note...in https://github.com/microsoft/LightGBM/pull/2936/commits/6ca2be8f3c66f16607f655344e51030e4e56c8ec, I removed `Rtools` mingw from `PATH`, so we could be sure that setting `CXX` explicitly was working.  I think that in #2965 we'll have to add it back, because that directory is also where `gendef.exe` is based.    I'll add a link to this comment on that PR.