Error Compiling with cmd prmpt
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
Code:
#include<QApplication>
#include<QLabel>
int main(int argc,char *argv[])
{
QApplicaiton app(argc, argv);
label->show();
return app.exec();
}
Re: Error Compiling with cmd prmpt
'QApplication' is misspelled in line 6.
Re: Error Compiling with cmd prmpt
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 :(
Re: Error Compiling with cmd prmpt
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.
Re: Error Compiling with cmd prmpt
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
Re: Error Compiling with cmd prmpt
Quote:
Originally Posted by
messifanboy
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)
Re: Error Compiling with cmd prmpt
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
Re: Error Compiling with cmd prmpt
Quote:
Originally Posted by
messifanboy
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.
Quote:
Originally Posted by
messifanboy
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.
Re: Error Compiling with cmd prmpt
i have installed Qtcreator also but still get the problem :(
Re: Error Compiling with cmd prmpt
Please use Creator tutorial and docs.
Re: Error Compiling with cmd prmpt
If you don't have visual studio, you'll need to use mingw32:
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)