C Programming & Mac OS Projects for $30 - $250. Dear, I have a QT project who works fine on Windows and Linux. I have to port on Mac OS. You'll need Qt Mysql and FFmpeg and their dependencies, and where to place configuration files and translation. The Qt library allows you to make really cross-platform applications. Once written code can be compiled for many operating systems. But the problem is precisely in the word 'compile' because it means that it is necessary to reboot to the target system, have a customized development environment, installed and configured zoo of libraries. Cross compilation is a solution - a compilation that.
1) Ensure system is up-to-date
Before installation, ensure your macOS operating system is current. Select menu -> 'System Preferences' -> 'Software Update' and check whether any OS updates are available. If so, install them first and only then proceed with the rest of this installation guide. In order to install QtCreator, you need to have a version of MacOS that is >= 10.13. If this is not possible for you, please reach out to the course staff ASAP.
2) Install Xcode tools
Apple's developer tools are bundled as a part of Xcode. Installing Xcode provides the C++ compiler that is used by Qt Creator.
To identify the correct version of Xcode to install, you need to know which OS you are running. Go to the menu -> 'About This Mac' and read the macOS version number.
- If you are running the macOS Catalina >= 10.15, you can install Xcode directly from App Store using the instructions below.
- If your macOS is 10.14 or older, you need an older version of Xcode. In particular, MacOS 10.14 is compatible with Xcode version 11.3, and MacOS 10.13 is compatible with Xcode version 10.1. You can find older versions of Xcode at Apple Developer Downloads. Find the appropriate .xip file for your macOS version and then follow the second set of instructions below.
To install from App Store:
- Select menu - > 'App Store…'.
- Search for Xcode. Download and install.
To install from Apple Developer Downloads: - Find and download the .xip file for the appropriate version of Xcode give your macOS version. - Once the file has downloaded, unzip the archive and install XCode. - Once Xcode has installed, you must drag the XCode icon into your Applications folder. After you have done this, open Xcode from the Applications folder by double-clicking on the icon and then follow the remaining instructions below.
Xcode is a very large app, so the download and stallation will take some time, and can be anywhere from 1-4 hours depending on your network connection speed. If your computer does not have enough space for Xcode, or if the download will take prohibitively long (more than 24 hours) due to the quality of your internet connection, reach out to Nick for alternate installation instructions.
3) Run Xcode once
After downloading Xcode, you have to actually launch the Xcode application one time to install its components.You can open Xcode using Spotlight (the magnifying glass at the top right of your screen) and typing in 'Xcode'.Click 'Agree' to accept the License Agreement and enter your password if prompted. Watch the progress bar 'Installing components…'. When it finishes, you may exit Xcode and do not need to launch it ever again for this course.
4) Download the Qt Creator installer
The Qt Creator official download site is https://www.qt.io/download-qt-installer.When you go to this site, it should detect that your computer is running MacOS and recommend the installer 'Qt Online Installer for Mac OS'. Click the green 'Download' button to download the installer.
5) Run the Qt Creator installer
The downloaded installer is named something like qt-unified-mac-version.dmg
. Double-click to mount the disk image and launch the installer.
The graphical installer launches and walks you through a set of steps. For most steps, you can use the default settings and simply click 'Next' or 'Agree' to move on, with the following exceptions:
- At the Qt Account step, you will have to create your own Qt Account.
- At the Select Components step:
- Select the highest-numbered Qt version. As of June 17, the latest release is Qt 5.15.0. Do not select any version labeled 'Preview' or 'Alpha' or 'Beta'.
- IMPORTANT: You must also select the macOS kit component. Expand the 'Qt' triangle, then expand the triangle with Qt version number, then click the checkbox labeled 'macOS'. If you are tight on disk space, you can un-check every other checkbox except for 'macOS', as shown in the screenshot below.
6) Confirm installation
IMPORTANT: Follow the check step instructions to build and run our sample project that confirm your Qt Creator is installed properly and works correctly.
7) Configure settings (optional)
For a better experience, we suggest changing some of the default settings, see our recommended configuration settings.
Qt is supported on a variety of 32-bit and 64-bit platforms, and can usually be built on each platform with GCC, a vendor-supplied compiler, or a third party compiler. In Qt Creator, a kit specifies the compiler and other necessary tools for building an application for and running it on a particular platform.
Qt Creator automatically detects the compilers that are registered by your system or by an installer and lists them in Tools > Options > Kits > Compilers:
You can add the following compilers to build applications by using other compilers or by using additional versions of the automatically detected compilers: F-secure antivirus for mac.
- GNU Compiler Collection (GCC) is a compiler for Linux and macOS.
- MinGW (Minimalist GNU for Windows) is a native software port of GCC and GNU Binutils for use in the development of native Microsoft Windows applications on Windows. MinGW is distributed together with Qt Creator and Qt installers for Windows.
- ICC (Intel C++ Compiler) is a group of C and C++ compilers. Only the GCC-compatible variant, available for Linux and macOS, is currently supported by Qt Creator.
- Clang is a C, C++, Objective C, and Objective C++ front-end for the LLVM compiler for Windows, Linux, and macOS.
- clang-cl is an alternative command-line interface to Clang that is compatible with the Visual C++ compiler,
cl.exe
. - Nim is the Nim Compiler for Windows, Linux, and macOS.
- QCC is the interface for compiling C++ applications for QNX.
Qt Compile For Mac High Sierra
In addition, the Qt Creator Bare Metal Device plugin provides support for the following compilers:
- IAREW is a group of C and C++ bare-metal compilers from the various IAR Embedded Workbench development environments.
Note: Currently supported architectures are
8051
,AVR
,ARM
,STM8
, andMSP430
. - KEIL is a group of C and C++ bare-metal compilers from the various KEIL development environments.
Note: Currently supported architectures are
8051
andARM
. - SDCC is a retargetable, optimizing C bare-metal compiler for various architectures.
Note: Currently supported architectures are
8051
andSTM8
.
Redetecting Compilers
When Qt Creator finds an x86_64 GCC compiler, it sets up an instance for the native x86_64 target. If you plan to create also 32-bit x86 binaries without using a dedicated cross-compiler, select Auto-detection Settings > Detect x86_64 GCC compilers as x86_64 and x86. Then select Re-detect to refresh the list of automatically detected compilers.
To remove manually added compilers, select Remove or Remove All.
Specifying Compiler Settings
To build an application using GCC, MinGW, Clang, or QCC, specify the path to the directory where the compiler is located and select the application binary interface (ABI) version from the list of available versions. You can also create a custom ABI definition. For QCC, also specify the path to the QNX Software Development Platform (SDP).
To enable Microsoft Visual C++ Compilers (MSVC) and clang-cl to find system headers, libraries, and the linker, Qt Creator executes them inside a command prompt where the environment has been set up using vcvarsall.bat
. For these compilers, you also specify the path to the script that sets up the command prompt.
You specify the compiler to use for each kit in Tools > Options > Kits.
To add C or C++ compilers:
- Select Tools > Options > Kits > Compilers > Add, then select a compiler in the list, and then select C or C++ to add a C or C++ compiler.
To clone the selected compiler, select Clone.
- In the Name field, enter a name for the compiler to identify it in Qt Creator.
- In the Compiler path field, enter the path to the directory where the compiler is located.
- In the Platform codegen flags field, check the flags passed to the compiler that specify the architecture on the target platform.
- In the Platform linker flags field, check the flags passed to the linker that specify the architecture on the target platform. The linker flags are used only when building with Qbs.
The other settings to specify depend on the compiler.
- In the ABI field, provide an identification for the target architecture. This is used to warn about ABI mismatches within the kits.
Adding Nim Compilers
To build an application using the Nim Compiler, select Tools > Options > Kits > Compilers > Add > Nim, and specify the path to the directory where the compiler is located.
Qt Compile For Mac 10.13
Adding Custom Compilers
To add a compiler that is not listed above or a remote compiler, use the Custom option and specify the paths to the directories where the compiler and make tool are located and options for the compiler.
To add other compilers:
- Select Tools > Options > Kits > Compilers > Add > Custom > C or C++.
- In the Name field, enter a name for the compiler.
- In the Compiler path field, enter the path to the directory where the compiler is located.
- In the Make path field, enter the path to the directory where the make tool is located.
- In the ABI field, specify the ABI version.
- In the Predefined macros field, specify the macros that the compiler enables by default. Specify each macro on a separate line, in the following format: MACRO[=value].
- In the Header paths field, specify the paths to directories that the compiler checks for headers. Specify each path on a separate line.
- In the C++11 flags field, specify the flags that turn on C++11 support in the compiler.
- In the Qt mkspecs field, specify the path to the directory where mkspecs are located. Usually, the path is specified relative to the Qt mkspecs directory.
- In the Error parser field, select the error parser to use. You can add custom output parsers to the list. For more information, see Using Custom Output Parsers.
Qt Compile Mac Osx
After downloading Xcode, you have to actually launch the Xcode application one time to install its components.You can open Xcode using Spotlight (the magnifying glass at the top right of your screen) and typing in 'Xcode'.Click 'Agree' to accept the License Agreement and enter your password if prompted. Watch the progress bar 'Installing components…'. When it finishes, you may exit Xcode and do not need to launch it ever again for this course.
4) Download the Qt Creator installer
The Qt Creator official download site is https://www.qt.io/download-qt-installer.When you go to this site, it should detect that your computer is running MacOS and recommend the installer 'Qt Online Installer for Mac OS'. Click the green 'Download' button to download the installer.
5) Run the Qt Creator installer
The downloaded installer is named something like qt-unified-mac-version.dmg
. Double-click to mount the disk image and launch the installer.
The graphical installer launches and walks you through a set of steps. For most steps, you can use the default settings and simply click 'Next' or 'Agree' to move on, with the following exceptions:
- At the Qt Account step, you will have to create your own Qt Account.
- At the Select Components step:
- Select the highest-numbered Qt version. As of June 17, the latest release is Qt 5.15.0. Do not select any version labeled 'Preview' or 'Alpha' or 'Beta'.
- IMPORTANT: You must also select the macOS kit component. Expand the 'Qt' triangle, then expand the triangle with Qt version number, then click the checkbox labeled 'macOS'. If you are tight on disk space, you can un-check every other checkbox except for 'macOS', as shown in the screenshot below.
6) Confirm installation
IMPORTANT: Follow the check step instructions to build and run our sample project that confirm your Qt Creator is installed properly and works correctly.
7) Configure settings (optional)
For a better experience, we suggest changing some of the default settings, see our recommended configuration settings.
Qt is supported on a variety of 32-bit and 64-bit platforms, and can usually be built on each platform with GCC, a vendor-supplied compiler, or a third party compiler. In Qt Creator, a kit specifies the compiler and other necessary tools for building an application for and running it on a particular platform.
Qt Creator automatically detects the compilers that are registered by your system or by an installer and lists them in Tools > Options > Kits > Compilers:
You can add the following compilers to build applications by using other compilers or by using additional versions of the automatically detected compilers: F-secure antivirus for mac.
- GNU Compiler Collection (GCC) is a compiler for Linux and macOS.
- MinGW (Minimalist GNU for Windows) is a native software port of GCC and GNU Binutils for use in the development of native Microsoft Windows applications on Windows. MinGW is distributed together with Qt Creator and Qt installers for Windows.
- ICC (Intel C++ Compiler) is a group of C and C++ compilers. Only the GCC-compatible variant, available for Linux and macOS, is currently supported by Qt Creator.
- Clang is a C, C++, Objective C, and Objective C++ front-end for the LLVM compiler for Windows, Linux, and macOS.
- clang-cl is an alternative command-line interface to Clang that is compatible with the Visual C++ compiler,
cl.exe
. - Nim is the Nim Compiler for Windows, Linux, and macOS.
- QCC is the interface for compiling C++ applications for QNX.
Qt Compile For Mac High Sierra
In addition, the Qt Creator Bare Metal Device plugin provides support for the following compilers:
- IAREW is a group of C and C++ bare-metal compilers from the various IAR Embedded Workbench development environments.
Note: Currently supported architectures are
8051
,AVR
,ARM
,STM8
, andMSP430
. - KEIL is a group of C and C++ bare-metal compilers from the various KEIL development environments.
Note: Currently supported architectures are
8051
andARM
. - SDCC is a retargetable, optimizing C bare-metal compiler for various architectures.
Note: Currently supported architectures are
8051
andSTM8
.
Redetecting Compilers
When Qt Creator finds an x86_64 GCC compiler, it sets up an instance for the native x86_64 target. If you plan to create also 32-bit x86 binaries without using a dedicated cross-compiler, select Auto-detection Settings > Detect x86_64 GCC compilers as x86_64 and x86. Then select Re-detect to refresh the list of automatically detected compilers.
To remove manually added compilers, select Remove or Remove All.
Specifying Compiler Settings
To build an application using GCC, MinGW, Clang, or QCC, specify the path to the directory where the compiler is located and select the application binary interface (ABI) version from the list of available versions. You can also create a custom ABI definition. For QCC, also specify the path to the QNX Software Development Platform (SDP).
To enable Microsoft Visual C++ Compilers (MSVC) and clang-cl to find system headers, libraries, and the linker, Qt Creator executes them inside a command prompt where the environment has been set up using vcvarsall.bat
. For these compilers, you also specify the path to the script that sets up the command prompt.
You specify the compiler to use for each kit in Tools > Options > Kits.
To add C or C++ compilers:
- Select Tools > Options > Kits > Compilers > Add, then select a compiler in the list, and then select C or C++ to add a C or C++ compiler.
To clone the selected compiler, select Clone.
- In the Name field, enter a name for the compiler to identify it in Qt Creator.
- In the Compiler path field, enter the path to the directory where the compiler is located.
- In the Platform codegen flags field, check the flags passed to the compiler that specify the architecture on the target platform.
- In the Platform linker flags field, check the flags passed to the linker that specify the architecture on the target platform. The linker flags are used only when building with Qbs.
The other settings to specify depend on the compiler.
- In the ABI field, provide an identification for the target architecture. This is used to warn about ABI mismatches within the kits.
Adding Nim Compilers
To build an application using the Nim Compiler, select Tools > Options > Kits > Compilers > Add > Nim, and specify the path to the directory where the compiler is located.
Qt Compile For Mac 10.13
Adding Custom Compilers
To add a compiler that is not listed above or a remote compiler, use the Custom option and specify the paths to the directories where the compiler and make tool are located and options for the compiler.
To add other compilers:
- Select Tools > Options > Kits > Compilers > Add > Custom > C or C++.
- In the Name field, enter a name for the compiler.
- In the Compiler path field, enter the path to the directory where the compiler is located.
- In the Make path field, enter the path to the directory where the make tool is located.
- In the ABI field, specify the ABI version.
- In the Predefined macros field, specify the macros that the compiler enables by default. Specify each macro on a separate line, in the following format: MACRO[=value].
- In the Header paths field, specify the paths to directories that the compiler checks for headers. Specify each path on a separate line.
- In the C++11 flags field, specify the flags that turn on C++11 support in the compiler.
- In the Qt mkspecs field, specify the path to the directory where mkspecs are located. Usually, the path is specified relative to the Qt mkspecs directory.
- In the Error parser field, select the error parser to use. You can add custom output parsers to the list. For more information, see Using Custom Output Parsers.
Qt Compile Mac Osx
Troubleshooting MinGW Compilation Errors
If error messages displayed in the Compile Output pane contain paths where slashes are missing (for example, C:QtSDK
), check your PATH variable. At the command line, enter the following commands:
If these commands show paths, they have been added to the global PATH variable during the installation of a tool chain based on Cygwin or MinGW, even though this is against Windows conventions.
Qt Compile For Mac On Linux
To keep working with the third-party tool chain, create a new shell link that adds the required paths (as Visual Studio and Qt do). The shell link must point to cmd.exe, as illustrated by the following example:
C:WindowsSystem32cmd.exe /K C:path_tomyenv.bat
where the /K parameter carries out the command specified in the bat file.
Qt Creator For Mac
Create the myenv.bat file at path_to, which should be in a convenient location. In the file, specify the paths to the tool chains. For example,
set PATH=C:path1;C:path2;%PATH%
Qt Designer Mac
where path1 and path2 are paths to the tool chains.
Finally, remove the paths from the global PATH, reboot the computer, and run the where
commands again to verify that the global PATH is now clean.
You can use the shell link to run the tools in the third-party tool chains.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.