0
Compiling	
  Qt	
  -­‐	
  apps	
  
Jussi	
  Pohjolainen	
  
Tampere	
  University	
  of	
  Applied	
  Sciences	
  
source.cpp	
  
#include <QtWidgets>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLabel b;
b.setText("mo...
Crea@ng	
  Project	
  
•  Create	
  new	
  projecBolder	
  and	
  save	
  the	
  
source.cpp	
  into	
  the	
  folder	
  
...
pro?	
  
######################################################################
# Automatically generated by qmake (3.0) k...
qmake	
  
•  AGer	
  building	
  the	
  project	
  –	
  file,	
  we	
  well	
  create	
  
a	
  pla$orm	
  specific	
  makefil...
qmake	
  usage	
  on	
  Mac	
  OS	
  X	
  
make	
  and	
  running	
  
•  make	
  will	
  compile	
  the	
  applica@on	
  using	
  the	
  
instruc@ons	
  in	
  the	
 ...
Compiling	
  and	
  Running	
  
Build	
  Steps	
  
•  qmake –project
– Creates	
  plaBorm	
  independent	
  project	
  file	
  
•  qmake
– Creates	
  plaBo...
Upcoming SlideShare
Loading in...5
×

Compiling Qt Apps

1,058

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,058
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Compiling Qt Apps"

  1. 1. Compiling  Qt  -­‐  apps   Jussi  Pohjolainen   Tampere  University  of  Applied  Sciences  
  2. 2. source.cpp   #include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); QLabel b; b.setText("moi"); b.show(); return a.exec(); }
  3. 3. Crea@ng  Project   •  Create  new  projecBolder  and  save  the   source.cpp  into  the  folder   – /QtHelloWorld/source.cpp •  Create  plaBorm  independent  project  file   – qmake –project •  Creates   – /QtHelloWorld/QtHelloWorld.pro
  4. 4. pro?   ###################################################################### # Automatically generated by qmake (3.0) ke maaliskuuta 4 10:34:14 2015 ###################################################################### TEMPLATE = app TARGET = QtHelloWorld INCLUDEPATH += . # add this! QT += widgets # Input SOURCES += source.cpp
  5. 5. qmake   •  AGer  building  the  project  –  file,  we  well  create   a  pla$orm  specific  makefile   •  makefile  =  informa@on  how  to  build  the   target  program  (compile  instruc@ons)   •  In  Mac  OS  X,  the  qmake  creates  automa@cally   Xcode  –  project  files.  Use:  qmake -spec macx-g++ •  In  other  systems,  qmake should  be  enough.  
  6. 6. qmake  usage  on  Mac  OS  X  
  7. 7. make  and  running   •  make  will  compile  the  applica@on  using  the   instruc@ons  in  the  makefile   •  AGer  compila@on  you  can  run  the  applica@on  
  8. 8. Compiling  and  Running  
  9. 9. Build  Steps   •  qmake –project – Creates  plaBorm  independent  project  file   •  qmake – Creates  plaBorm  specific  makefile   •  make – Compiles  the  applica@on   •  ./helloworld – Starts  the  app  (depends  on  the  plaBorm)  
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×