Respect the author, support the original, if you need to reprint, please attach the original address: http://blog.csdn.net/libaineu2004/article/details/46234079
With QT development under Mac OS X, QT libraries and compilers need to be configured. The compiler can only use clang that Apple has developed on its own.
1, respectively download and install Xcode and command line Tools (must be installed), after installation, clang.
https://developer.apple.com/downloads/
2. Download qt and install it by default
http://download.qt.io/official_releases/qtcreator/, get the installation package qt-creator-opensource-mac-x86_64-3.4.0.dmg.
http://download.qt.io/official_releases/qt/, Get the installation packages QT-OPENSOURCE-MAC-4.8.7.DMG and QT-OPENSOURCE-MAC-4.8.7-DEBUG-LIBS.DMG.
The former is the QT release version of the SDK, must be installed, the latter is the debug version of the SDK, optional installation, if the user needs a single-step breakpoint debugging, it must be installed.
3. Configure QT
(1) Run QT Creator. Go to "menu", "Qt Creator", "preferences". As you can see, the "Compiler" and "debugger" are already set by default.
(2) Users need to manually configure the QT version
(3) Once again go to "preferences", users need to manually configure the build suite.
4, appendices, about LLVM and clang
http://www.llvm.org/
http://clang.llvm.org/
LLVM is an open-source compiler architecture that has been successfully applied to multiple application areas. Clang (pronounced/klæ?/) is a compiler front-end for LLVM, which currently supports programming languages such as C, C + +, objective-c, and objective-c++. Clang to the source program lexical analysis and semantic analysis, and the results of the analysis into the abstract Syntax tree (abstract syntax trees), and finally use LLVM as the generator of back-end code.
Clang's development goal is to provide a front-end compiler that can replace GCC. Compared to GCC, Clang is a redesigned compiler front end with a number of advantages, such as modularity, code simplicity, low memory footprint, and ease of expansion and reuse. Due to the excellent design of the Clang, the Clang is well suited for the design of source code level analysis and conversion tools. Clang has also been applied to a number of important development areas, such as static analysis, which is a Clang-based, statically-coded analytical tool.
Clang background: Since the GNU compiler Suite (GCC) system is huge, and Apple's heavily used objective-c in GCC has a lower priority, and GCC as a purely compiled system, with the IDE is not good, Apple decided to start from scratch Write the front end of C family, which is based on the LLVM Clang. Clang is developed by Apple and the source code authorizes the use of BSD's open source licensing.
5. Appendices, about MinGW and GCC
http://www.mingw.org/
http://gcc.gnu.org/
MinGW: A free-to-use and free-to-publish Windows-specific header file and a collection of imported libraries using the GNU toolset, allowing you to generate local Windows programs without the need for a third-party C run-time library. MinGW, minimalist GNU for Windows. It is a collection of header files and port libraries that allow people to use GCC to generate WINDOWS32 programs without a third-party dynamic-link library.
In the basic layer, MinGW is a set of files and port libraries, which feature a program that allows console mode to use Microsoft's standard C run time library (MSVCRT.DLL), which is valid on all NT OS, valid on all Windows 95 distributions above Windows OS, Using the basic run time, you can use the GCC write console mode in accordance with the US Standardization Organization (ANSI) program, which can be used by Microsoft to provide a C run time extension. This feature is not available with the Windows32 API. The next component is the W32API package, which is a set of include files and port libraries that can be used with the Windows32 API. Combined with basic uptime, you can have full rights to use both the CRT (C runtime) and the WINDOWS32 API functionality.
MinGW Tools Collection
In fact, MinGW is not a simple C + + compiler, but a set of GNU tools. In addition to GCC, MinGW also contains some other GNU program development tools (such as gawk bison, etc.). The MinGW was developed to provide a GNU-compliant GNU working environment for those who do not like to work on the Linux (FreeBSD) operating system and remain in Windows. So, using MinGW, we can use the GNU Program development tool just like under Linux.
GCC is the core of MinGW, and GCC is a set of compiler systems that support a wide range of computer programming languages, and are closest to the standard in the implementation of language standards. And GCC can be ported to almost all available computer platforms today. (My computer is also equipped with Devkitpro, which contains GCC's ARM (for GBA/DS/GP32) and MIPS (for PSP) versions. )
GCC itself does not have an IDE interface like VC (the IDE that supports the MinGW compiler, such as Dev C + +, is also available on Windows). Source code editing You can choose any text editor you like (it is said that Microsoft developers, including VC development are not using the VC IDE Editor, but the GNU VIM editor). Then use tools such as make to compile, link, package, and even publish software projects. And like the CVS (SVN) Source version Control tool, people in any corner of the world can get involved in a software project.
About MFC, the Microsoft Foundation Library class, this with VC + + carried a source code open development package, and other Windows program development package is the same. If you have VC + + authorization, you can fully use the source code of MFC, that is, you use GCC to compile MFC program is completely possible.
Of course, there are many Windows program development packages under GNU, even some of which are supported across platforms. It is not only possible to compile the source code directly into a Windows program, but also to compile the graphics program into other operating systems without modification.
However, under GNU, the most popular graphical interface development library is GTK + and Qt. Both GTK + and QT offer cross-platform support. For example, QT supports operating system platforms such as Windows, Linux, Mac OS X, Windows CE, Symbian, Meego, and Qt SDK (including the QT Creator integrated development environment). GTK also works well on Windows platforms (such as GIMP and Gaim).
Generally speaking, MinGW is the GNU toolset. GCC (GNU Compiler Collection,gnu Compiler Set) is a set of programming language compilers developed by GNU. It is a set of free software issued under the GPL and LGPL license, and is a key part of the GNU program.
Respect the author, support the original, if you need to reprint, please attach the original address: http://blog.csdn.net/libaineu2004/article/details/46234079
Welcome to visit the sister article "QT under Windows three programming environment building"!
QT programming environment built under MAC OS X