close
軟體 : QT4.4.0

qmake是Trolltech提供的一套簡化在不同平台進行專案的"build(建立)"流程的工具。
qmake
is a tool from Trolltech that helps simplify the build process for development project across different platforms.

 拿QT所提供的範例來做示範,在QT位置所在的資料夾的 examples/qmake/tutorial中有:
hello.h
hello.cpp

將這兩個檔案copy到C槽,並新建一個"hello"的資料夾來存放這兩個檔案,



打開程式集中的QT4.4.0 Command Prompt


切換到C:\hello


qmake -project =>生成hello.pro,告訴qmake與開發專案相關的souece與header檔的部份。





hello.pro的內容:

######################################################################
# Automatically generated by qmake (2.01a) ??? ?? 2 08:09:11 2008
######################################################################

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
HEADERS += hello.h
SOURCES += hello.cpp main.cpp


qmake => 生成Makefile文件





此時debug與release兩個資料夾還是空的,



nmake(亦可用make,取決於所使用的compiler) =>執行Makefile中的命令,



此時debug資料夾中出現hello.exe


cd debug =>進入debug資料夾
hello =>運行编譯鏈接好的exe文件


執行的hello.exe

 

 

 

arrow
arrow
    全站熱搜

    fishark 發表在 痞客邦 留言(3) 人氣()