There must be a way of configuring it to stop it doing this.
In the meantime, if you are not connected to the internet it would be safe to turn off Kaspersky while you are coding, right click the icon on the bottom bar and select exit to pause protection.
Strangely it blocks gfxlib stuff here and allows opengl.