This library provide a cross-platform application and UI framework.
To start programming with this library in windows we need to install first minGW (gcc ported to windows), you can download it here.
At the end of the installation add the minGW/bin folder to your PATH variable, to do this go to
control panel>system>advanced system settings>advanced>environment variables
;C:\MinGW\bin
now to check if everything it's working open the command line and try writing
make
If it's recognized as a command you've done everything right else try checking this tutorial for the installation.
Now we need to install the Qt library that you can download here.
When you finished downloading, install the library and add the C:\Qt\4.8.2\bin
to the environment variables just like we have done with the minGW binaries.
When you've done check if everything is working writing in the command line
qmake
To start programming create file main.cpp and write this code:
#include <Qt/QApplication.h> #include <Qt/QWidget.h> int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setWindowTitle("Example"); window.show(); return app.exec(); }
Now open a command line and move to the folder that contains the file using cd command and then write this in the command line to compile the file:
qmake -project
qmake
make
If there's no error in your code or in the environment variables you will find the compiled file in the debug folder.
I hope you like this post, if you have any question please comment or send me an e-mail to damianoandre@gmail.com
Bye, Dami
Nessun commento:
Posta un commento