Using a basic command navigate to the directory that contains your .cpp file. (Say c:\Qt\demos\boxes\)
c:\> cd c:\Qt\demos\boxes\
c:\Qt\demos\boxes\> qmake
c:\Qt\demos\boxes\> make
2) How to create .pro file for the project?
c:\Qt\demos\boxes\> qmake -project
This command will automatically generate project file(.pro file).
3) How to add library to Command Line command?
qmake -project QT+=network