Whitelisting does not help with Kaspersky, at least it did not help 2 years ago when I last used it.
The only working solution is to write a nasty letter to Kaspersky, asking your money back, and using a different product. I'm using Avast now, which has its own set of problems, but at least lets you whitelist Code::Blocks and GCC so it has zero impact on performance.