I installed MinGW that comes with CL, rebuild wxWidgets, did a clean CL checkout and tried to build CL with old CL 4984 but with the same 'AttachConsole' error.
Then I used CL 5006 to build and that finally worked. So I could build CL 5012 now, but it has the same bug as 5006, the key '<>|' (the key right beside the left SHIFT key on my German keyboard) is dead.

Regards
Frank