I modified the main.cpp file to be similar to the one you sent. My code is now compiling and working!! Thanks a lot.
As for the Qwt plugin, I knew that qwt4.2 is coming default with Debian Sarge. They do not seem to be bundling the plugin with the package. From the qwt website qwt.sourceforge.net I downloaded the source package for qwt4.2 which comes with plugin also within it. I compiled it and copied the libqwtplugin.so to the correct plugin location manually as root(make install was not copying it to correct location). Once I did that my qwt widgets now appear in qwt designer. Now I have to start using them!!