Are you searching for how to program C++ apps in 2022? Well, you’ve come to the right place! The C and C++ programming languages are the most popular programming languages and they can be used to develop apps in many different operating systems. You can develop apps in C++ for iOS, Windows, Android, Linux and for the other native systems, IoTs like Arduino, and others like the Raspberry Pi. There are free C++ SDKs and with free tools like Dev-C++ and C++ Builder CE to develop one app for multiple operating systems (called multi-device apps). Before you start you should check the exact versions and ‘target devices’ your C++ IDE and its compiler can support. This list changes over time thanks to the very dynamic mobile device market and the on-going development of tools used to program C++ apps.
Table of Contents
What sort of things can we program C++ apps to do?
Many diverse professional applications are developed with the C++ programming language. Even very well known solutions such as the Windows Operating System, MS Office, Adobe’s Photoshop, Illustrator, Chrome (Chromium), MySQL, are all written entirely or mostly using C++. There may be millions of professional apps, libraries and components written in the C++ language. Many sub modules and add-ons for programming languages are written in C++ too, for example many Python modules are often developed in C++.
Where did the idea to program C++ apps originate? Is C++ the same as C?
The C Programming Language was developed in the 1970s and since 1970, there have been many programming languages and have been many changes in C language, like C+, C++, CLANG standards C++99, C++11, C++14, and C++17. The C++ programming language includes many elements of the C language and goes further by adding object oriented programming features like classes, objects, and methods.
A C++ Compiler is a computer program that converts one programming language (i.e. C/C++ codes) written with text into executable machine code with a linker. In general, All computers (CPU/GPU) work with machine code (code that can be directly programmed by assembler codes) that tells the computer what to do (exe files are this kind of file). This is the most native and fastest code, but it requires writing many lines for simple things and is hard to generalize for all kinds of machines. C and C++ are very helpful to reach about the coding in assembler level (let’s say close to the assembler level). This means your any C or C++ app is using CPU and GPU in maximum speed, in minimum memory usage and maximum efficiency.
A C++ compiler is a great tool to develop applications when the compiler and linker are paired with a professional C++ IDE to empower activities like Windows app development. According to TIOBE Index the, C and C++ programming language have more than 24.6+% share in total. The C+ language has more than 10.17% share and if you add Objective-C, Swift, and other C and C++ related programming languages it has about more than 33% share in worldwide and note that these are recorded from online data only.
How to program C++ apps with Embarcadero C++ Builder CE ?
Did you know you can start to code and program C++ apps with a free C++ compiler and editor? The C++ Builder CE IDE is a free tool and a very good choice to develop apps in both C++ for the different operating systems.
C++ Builder is the easiest and fastest C++ IDE for building simple or professional applications on the Windows, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. C++ Builder comes with Rapid Application Development Studio, also known as RAD Studio.
Professional developers can use the Professional, Architect or Enterprise versions of C++ Builder. Please visit https://www.embarcadero.com/products/cbuilder.
Download RAD Studio 11 Now
See What’s New in RAD Studio 11
Here are the features of the C++ Builder 11 version
- Provision apps for Windows 11
- Compile for Android API 30
- Compile for M-series (Apple Silicon) processors
- Design on high-DPI 4k+ screens
- View VCL Styles in design time
- New & modernized VCL components
- Use enhanced remote desktop support to collaborate remotely
You can download the free C++ Builder Community Edition here: https://www.embarcadero.com/products/cbuilder/starter.
Professional developers can use the Professional, Architect or Enterprise versions of C++ Builder. Please visit https://www.embarcadero.com/products/cbuilder.
How to program C++ apps that comply with CLANG standards ?
In Windows application development, native C++ compiler and IDE that supports the latest Windows features are very important. Some of the IDEs are not specifically designed for C++ development. Some IDEs are designed only for console application developments. Some are supports with few features, generally, you must install a C++ compiler with a lot of options changes, etc. In modern application development, professional developers use much stronger C++ IDE.
If the IDE development company also develops a compiler, these both together work well in integrity. Be sure that your C++ IDE comes with a CLANG-based compiler. Be sure that your IDE also supports, other C++ libraries and standards like Dinkumware standard library, MSBuild/CMake/Ninja support, and popular libraries like Boost and Eigen.
CLANG is considered to be a production-quality C, Objective-C, C++, and Objective-C++ compiler when targeting X86-32, X86-64, and ARM. It is a new C/C++ compiler standard (C++98, C++11, C++17, C++20, C++23 ..) supported by The LLVM Compiler Infrastructure Project, and has been a default compiler in recent years for most C/C++ compilers. This means that if you code for a CLANG compiler, most other IDEs, Compilers of Platforms will support your code without any changes. The latest C++17 standard is supported by most C++ compilers. More information about core language features can be found here.
We highly recommend you start with or to move to a CLANG Enhanced compilers like Embarcadero’s C++ Builder, which supports the CLANG (C++11, C++ 17) standard and has its own C++ Compiler, IDE, GUI Designer, and more. The C++Builder Standards and Clang Enhanced Compiler features can be found here.
Embarcadero’s C++ Builder CE is a shared free C++ IDE and Compiler for the community of freelance developers, startups, students, and non-profits, C++Builder Community Edition is a full-featured IDE for building iOS and Windows apps from a single modern C++ codebase (limited commercial use license). C++Builder Community Edition includes a code editor, powerful debugging tools, built-in access to popular local databases with live data at design time, Bluetooth and IoT capabilities, and a visual UI designer with support for pixel-perfect, platform-specific styling.
Is there a simple example of how to program C++ apps for İOS?
C++ Builder greets you with a Welcome Screen. You can create a new project by using File->New menu on the top. By using this menu. You can create a new MultiDevice Application in C++ Builder with FireMonkey framework or a new Windows VCL Application in C++ Builder with VCL framework or you can create a Console Application in C++. There are more options to develop more professional static, dynamic libraries.
When you create a project this will create a Project source code file and a Unit which has a visual window. Your project will have .bpr, .cpp, PCH.h files, this project also includes two more .cpp and .h units. You can start designing your app with this ready-made unit as launching point, adding your own code by modifying these Unit files and its .h header. You can add more Units with new .cpp and .h files in your project..
Here are the full steps to develop iOS apps on Windows, but this is also a good example for Windows 32bits / 64bits apps and Android 32bits apps
Did you know you can download the free C++ Builder Community Edition so you can program C++ apps for iOS on Windows?
C++ Builder CE is the easiest and fastest Windows 10 development C & C++ IDE tool to develop simple or professional applications on iOS. It is also easy for beginners to learn with its wide range of samples, tutorials, help files and LSP support. C++ Builder comes with Rapid Application Development Studio, also knowns as RAD Studio, and C++ Builder is one of the most professional IDEs that work under RAD Studio.
So, if you haven’t already done so, download the free C++ Builder Community Edition here: https://www.embarcadero.com/products/cbuilder/starter.Professional developers can use the Professional, Architect or Enterprise versions of C++ Builder. Please visit https://www.embarcadero.com/products/cbuilder.
How to install RAD Studio and C++ Builder to program C++ apps with iOS platform support?
Run the RAD Studio Installer and during installation be sure that C++ Builder iOS Enterprise is checked as below. See Additional Options tab, select Samples and Help or any other options needed, then press Apply.
If you forget to install iOS support don’t worry, RAD Studio / C++ Builder allows you to install these packages from the IDE. Just run RAD Studio / C++ Builder go to Tools -> Manage Platforms … then check C++ Builder iOS Enterprise option. See Additional Options tab, select Samples and Help or any other options needed, then press Apply. This will Install the latest iOS development packages for the C++ Builder.
How to create a new C++ multi-device project to program your C++ apps to run cross-platform?
Now follow these steps:
1. Choose File->New-> “Multi Device Application- C++ Builder” menu
2. Select Blank Application to develop application with a blank form UI. You can add many UI components on it later.
3. Save all Unit File and Project file to a folder by using File -> Save Project As .. menu. For example: Folder name can be MyIOSApp and Unit file name MyIOSApp_Unit1.cpp and the project name MyIOSProject_Project1
In the C++ Builder project window, change your platform to iOS
On the right side there is Project window which lists platforms for this project. Multi-Device projects can be compiled for Windows, iOS or Android, the default is Windows 32-bit. To see these OS platforms, click the > icon on the left of Target Platforms section. This will show platforms, then double click to activate iOS Device 64-bit. After this all compilations will be done for the iOS platform. Anytime, you can back to Windows or Android and you can compile your project for that platform too.
How to add the UI items you want to use in your form’s design when you program C++ apps?
In C++ Builder, you can add your UI elements (also called as components) by dragging them from your Palette Window. There are many visual and non visual components for the C++ Builder. For example,
- Add Button (TButton) and Memo (TMemo) components to your Form (TForm) design by dragging these components from your Palette Window.
- You can set Style selector to iOS and View selector to an iOS Device.
- Double Click to Button1 on your Form Design. This will create OnClick() event of this Button which is Button1Click() event, a method runs when clicked. Here is a form example that we create as an iOS application.
How to add your C++ code to develop iOS apps on Windows?
Note that you can easily switch between the UI form design and the code editor area by pressing the F12 key. Or you can also use the tabs below the IDE. You can easily switch between .cpp, or .h header code and Design.
If you did 3rd part of Step 4, now, you can modify inside of Button1Click()
as given example below,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#include <fmx.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.fmx" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { UnicodeString ustr; ustr.printf(L"Hello, Pi is %8.3f",M_PI); Memo1->Lines->Add(ustr); } |
This example above is a modern “Hello World” example for iOS which runs with C++ Builder. Modern applications have a GUI. Note that VCL projects are Windows only. FireMonkey FMX projects are multi device (multi-platform) applications that you can compile and run on Windows, MacOS, iOS and Android.
How do I install PA Server to enable a connection between your Windows PC and a Mac?
The Platform Assistant server (named paserver) is a command-line application that can be installed on Windows, macOS, and Linux. You install the Platform Assistant on a remote system, or one in the same network as your development system. The PAServer lets RAD Studio interact with that remote system, so that you can develop cross-platform (multi-device) applications for macOS, iOS, Linux, or Win64. The Platform Assistant also allows you to debug applications remotely. PA Server acts as the bridge between RAD Studio which runs on a Windows PC or Windows virtual machine and a non-Windows machine such as a Mac. This is because RAD Studio and C++ Builder are Widows apps but some targets like Apple devices must be ‘code signed’ and packaged on Apple hardware (in the case of iOS and macOS) or a Linux system (in the case of Linux targets).
The Platform Assistant needs to be running and connected to the IDE in order for you to do the following:
- Run and debug multi-device applications remotely (Win64, macOS, iOS, Linux).
- Deploy multi-device applications (Win64, macOS, iOS, Linux).
- Add to RAD Studio a local copy of a macOS or iOS SDK, which is a prerequisite for developing Delphi or C++ applications for macOS, iOS or iOS Simulator (Delphi only).
Installing PA Server on Mac:
Here is the latest official link that explains how to install PA Server on a Mac device,
https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Installing_the_Platform_Assistant_on_a_Mac
Running PA Server on Mac:
Here is the latest official link that explains how to run PA Server on Mac device,
https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Running_the_Platform_Assistant_on_a_Mac
Installing the PAServer Manager on a Mac:
Here is the latest official link that explains how to install PA Server Manager on Mac device,
https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Installing_the_PAServer_Manager_on_a_Mac
Acquiring Permission to Support Debugging on a Mac:
Here is the latest official link that explains how to acquire permissions to support debugging on a Mac device,
More about PA Server:
If you need to know more about PA Server for different Operating Systems please check this official page
How to create a connection profile to compile and deploy your C++ apps
If you installed PA Server successfully press F9 to run click Run with Debugging.
The first time you will be asked for to provide a name for the Connection Profile for the PA Server. Give a name which makes sense to you and then enter your remote machine IP and passwords as below,
For the general usage in C++ Builder;
1. Run the project by hitting F9 or click Run with Debugging.
2. If there is an error, please check your code and act on any highlighted error lines. You can hit the F1 key to get context-sensitive help on any errors.
3. If all is fine then save the project by selecting “save all” from the file menu in the C++ IDE.
If you are a beginner “Hello World” examples are good to understand features of that programming language. It is good to understand how to edit text, how to write in its format, how to compile and link, how to debug and execute, and how to deploy or release the finished program. If you still have problem during these steps or you want to learn more about iOS development, follow this official link
C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.
There is a free C++ Builder Community Edition for students, beginners, and startups; it can be downloaded from here. For professional developers, there are Professional, Architect, or Enterprise versions of C++ Builder and there is a trial version you can download from here.
Design. Code. Compile. Deploy.
Start Free Trial
Free C++Builder Community Edition