Thanks for the tip jacek!

It turns out that i have MiKTex installed (a Latex program) which comes with its own set of QtCore4.dll and QtGui4.dll and the path to it is written in the PATH env variable. In addition, the path to MiKTeX libs preceded the path to QT's libs in the PATH list. So when it was linking in debug it would look in MiKTeX directory for debug version of QT libs wouldn't find them and move on to the QT directory. But in release mode it would find the libs in the MiKTex directory and load them up and then when it tried to load QtOpenGL4.dll from Qt directory it wouldn't match with core libs.

Now all i did was change the order of the paths in the PATH variable so the QT path is first in the list and everything seems to work just fine.

Just a quick follow up then. Is that the best solution for this problem or there's something more elegant?

So thanks again for the tip.

Cheers.