PDA

View Full Version : Error Compiling with cmd prmpt



messifanboy
7th October 2009, 14:58
I am using windows and when I enter this command i get the following errors
C:\>qmake yellow.cpp
c:\yellow.cpp:4: Unknown test function: int main
c:\yellow.cpp:6: Unknown test function: QApplicaiton app
c:\yellow.cpp:6: Parse Error ('QApplicaiton app(argc, argv);')
c:\yellow.cpp:6: Unterminated conditional block at end of file
Error processing project file: yellow.cpp

this is my yellow.cpp file



#include<QApplication>
#include<QLabel>

int main(int argc,char *argv[])
{
QApplicaiton app(argc, argv);
QLabel *label=new QLabel("Yellow Fellows");
label->show();
return app.exec();
}

lyuts
8th October 2009, 07:55
'QApplication' is misspelled in line 6.

messifanboy
8th October 2009, 10:47
thanks but i am still getting the error , can you tell me how to compile and run through Qt cmd prompt cause i might be wrong :(

yogeshgokul
8th October 2009, 10:54
The program is right (except misspelled QApplication). It seems there is aome problem regarding your Qt installation. Please provide some more information about your build system and what procedure you are following to compile this code.

messifanboy
8th October 2009, 10:57
first I go into the folder where my .cpp file is , then i do qmake -project and then I do qmake yellow.cpp and then i get those errors

yogeshgokul
8th October 2009, 11:02
then I do qmake yellow.cpp and then i get those errors
This is the problem.
You doesn't need to do that. Your 1st and second step was fine. So now your steps shall be.
1. "QMake -poject" (To generate .pro file)
2. "QMake" (To generate make files)
3. "nmake" (To build the project with Microsoft compiler)

messifanboy
8th October 2009, 11:07
When i do the third step i get this
'nmake' is not recognized as an internal or external command,
operable program or batch file.

And i just installed the Qt framework , don't have visual studio

yogeshgokul
8th October 2009, 11:23
When i do the third step i get this
'nmake' is not recognized as an internal or external command,
operable program or batch file. This is because, it cannot find the compiler on your machine.


And i just installed the Qt framework , don't have visual studio
I assume, you used binary installer for that.
In order to get your application running, you must have an IDE.
Use QtCreator (http://qt.nokia.com/products/developer-tools).

messifanboy
8th October 2009, 11:40
i have installed Qtcreator also but still get the problem :(

yogeshgokul
8th October 2009, 11:54
Please use Creator tutorial and docs.

squidge
8th October 2009, 18:54
If you don't have visual studio, you'll need to use mingw32:


mingw32-make

Make sure mingw\bin dir is in your PATH. It will be in the same directory as LICENSE - one step up from $QTDIR, assuming you installed Windows framework including QtCreator (In which case using QtCreator itself would be much easier)