If it really is mainform.cpp, maybe you can comment out (temporarily) certain parts of the code in that file to see what might be causing it (though making sure it's still compileable)? Divide and conquer, etc.
Was there something you changed recently that caused the slow linking? Added any libraries?

If it's always been slow, I'd just go ahead and blame Microsoft.