tham khảo thêm phần thiết lập biến môi trường bài
http://skywolfbiz.blogspot.com/2012/04/qt-cai-at-qt-sdk-va-qt-creator-tren.html
Bước 1: các bạn tạo thư mục hello và một file hello.c với nội dung
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
Sau khi lưu file lại, các bạn mở công cụ dòng lệnh, chuyển đến thư mục helloBước 2: tạo file Project
gõ lệnh:
qmake -project
file hello.pro sẽ được tạo ra.Bước 3: tạo file make
gõ lệnh:
qmake hello.pro
Bước 4: Biên dịch:
Nếu muốn tạo ra file debug các bạn gõ lệnh:
make
hoặc
make -f Makefile.debug
Nếu muốn tạo ra phiên bản release thì gõ lệnh:
make -f Makefile.release
Bước 5: chạy kết quả
Các bạn vào thư mục release hoặc thư mục debug vừa mới tạo ra và chạy file hello.exe.
Kết quả như sau:

Không có nhận xét nào:
Đăng nhận xét