問題描述
我剛開始使用 Qt 并注意到它使用自己的 make 工具, qmake.
I just started using Qt and noticed that it uses its own make tool, qmake.
- 為什么 Qt 使用自己的 make 工具?
- 是否有什么特殊原因阻止它使用標準的 make 工具?
- qmake 是否調用 GCC C++ 編譯器?
- Why does Qt use its own make tool?
- Is there something special that prevents it from using a standard make tool?
- Does qmake call the GCC C++ compiler?
推薦答案
Qt 使用 qmake 透明地支持 Qt 的各種插件,包括moc,元對象編譯器"(提供信號和槽),uic,theui 編譯器"(從 .ui 設計器文件創建頭文件)、rcc,資源編譯器"(編譯資源).
Qt uses qmake to transparently support Qt's various addons, including "moc, the meta-object compiler" (which provides signals & slots), "uic, the ui compiler" (which creates header files from .ui designer files), "rcc, the resource compiler" (which compiles resources).
沒有什么可以阻止您使用您想要的任何構建系統.然而,還有很多工作要做.例如,您需要對包含具有信號或槽的類的每個頭文件運行moc".一般不推薦使用,尤其是剛開始使用 Qt 的人.
There's nothing to stop you using any build system you want. however, it's a lot more work. For example, you need to run "moc" over every header file that contains a class that has signals or slots. In general it's not recommended, especially for someone who's just starting to use Qt.
QMake 不直接調用 g++/gcc.相反,qmake 在您當前的平臺上創建本機 make 文件.在linux下它創建標準的GNU make文件,在windows下它可以生成visual studio make文件,在Mac OS X下它可以生成XCode工程文件.然后調用您的本機構建系統(GNU make、MS NMake、xcodebuild 或其他),它將調用您的本機編譯器(g++/gcc 或其他).
QMake does not call g++/gcc directly. Instead, qmake creates native make files on your current platform. Under linux it creates standard GNU make files, under windows it can generate visual studio make files, under Mac OS X it can generate XCode project files. You then invoke your native build system (either GNU make, or MS NMake, or xcodebuild or whatever), which will call your native compiler (g++/gcc or whatever).
這篇關于為什么 Qt 使用自己的 make 工具 qmake?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!