![| Embarcadero RAD Studio Delphi C++Builder Blogs The Is The Step by Step Guide To Using A C++ Compiler](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/04/smartmockups_l1jhkp07-3999482.jpg?resize=1140%2C694&ssl=1)
C++ is an immensely powerful programming language and one of the world’s most with many ready-made variables, functions, methods, namespaces and libraries to enable you to write almost any app you could ever want. Using a fast and reliable C++ Compiler and IDE is very important for beginners and professionals to develop C++ apps for Windows and other operating systems. When a user wants to develop modern C++ applications, they should learn to use a professional IDE. In this post we explain the basics of C++ Builder as a guide for beginners.
An integrated development environment (IDE) is a software application that provides a complete set of features for application development. Code is generally written in text format, and you can easily edit or modify your code using text editors like Notepad, Word, WordPad, UltraEdit or similar. For a developer, beginner or professional, however, an IDE is really important because features like highlights, auto code completion and help system, and the opportunity to run, test, debug, deploy, merge or transform code on other platforms (multiplatform coding) are also important. All these capabilities require a powerful IDE.
Table of Contents
Step 1. Download the C++ Builder Community Edition Free
![cbuider_studio_final_icons_64-7772010-6139887](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/CBUIDER_STUDIO_FINAL_ICONS_64-7772010-6139887.png?w=750&ssl=1)
If you are new to C++ and want to compile code for the first time we recommend you try the free C++ Builder Community Edition for students, beginners, and startups. 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. C++ Builder comes with Rapid Application Development Studio, also known as RAD Studio, and C++ Builder is one of the most professional IDE’s that work under RAD Studio. It is the oldest IDE (it began as Borland TurboC in 1990 and was later renamed Borland C++ Builder). Under the Embarcadero brand, it comes with new versions, features, updates, and support. 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. More details about C++ Builder & RAD Studio for the beginners can be found in Official Wiki of Rad Studio.
![The Is The Step-by-Step Guide To Using A C++ Compiler. Screenshot of responsiive design.](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/smart-responsive-designing_test_02-1024x743-1102034-2362917.jpg?w=750&ssl=1)
Here are the features of the C++ Builder CE version;
- Build Windows and iOS C++ Applications 10x Faster with Less Code.
- C++Builder Community Edition provides you with an integrated toolchain and professional-level developer tools from Day 1
- Featuring Clang-enhanced compiler, Dinkumware standard library, MSBuild/CMake/Ninja support, and popular libraries like Boost and Eigen.
- Develop Windows and iOS applications with a single codebase and responsive UI
- Enjoy the award winning Visual Designer using the C++Builder VCL and FireMonkey frameworks for maximum productivity
- Built-in Debugging Tools that allow you to debug on any device
- Build database apps with local/embedded capabilities
- Hundreds of included components to enhance your app and reduce development cycles
- Direct access to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, MongoDB, and more.
- Licensed for use until your individual revenue from C++Builder applications or company revenue reaches $5,000 US or your development team expands to more than 5 developers
![CBuilder11512x5121x72861898695819 | Embarcadero RAD Studio Delphi C++Builder Blogs cbuilder 11 512x5121x 7286189 8695819](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/CBuilder_11_512x512@1x-7286189-8695819.png?resize=128%2C128&ssl=1)
C++ Builder CE is the easiest and fastest C & C++ IDE for developing simple or professional applications on different operating systems. 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.
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.
Step 2. Create a new C++ console project
If you download C++ Builder Community Edition (or RAD Studio CE version) or any Professional, Architect, Enterprise versions of C++ Builder. Install it on your windows computer and run RAD Studio or C++ Builder. Beginners and students normally start to learn C++ with simple code. For this reason, we want to show you how you can create a simple Console Application in C++.
- Choose File->New-> “Console Application – C++ Builder” menu
- There will be New Console Application window. When you create a console application generally you don’t need VCL or FMX frameworks. So, set Target Framework to None for a standard console application and press OK as below. so you can set the Target Framework to None as below and press OK.
![ConsoleApp8393155 | Embarcadero RAD Studio Delphi C++Builder Blogs The Is The Step by Step Guide To Using A C++ Compiler Picking the right framework](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/ConsoleApp-8393155.png?resize=408%2C305&ssl=1)
3. Save all Unit File and Project file to a folder.
2. Create a New C++ console project
Step 3. Add Your C++ Code
- When you create a console application your C++ code will have a
main
function and it will look like this,
1 2 3 4 5 6 |
#include <iostream> int main() { return 0; } |
2. inside the main()
function, between { and }, before the return command add these lines below,
1 2 |
std::cout << "Hello LearnCPlusPlus"; getchar(); |
or if you want you can clear all code there and copy this standard C++ code to run
1 2 3 4 5 6 7 8 9 |
#include <iostream> int main() { std::cout << "Hello C++ Developer"; getchar(); return 0; } |
This example above is a modern “Hello World” example for Windows which runs with C++ Builder. Modern applications have a GUI. VCL projects are Windows only. FireMonkey projects are Multi Device (multi-platform) applications that you can compile and run on Windows, MacOS, iOS and Android .
Step 4. Compile your C++ project
1.. Now you can compile this C++ code; just press the F9 key or just click the Run button in the center of top bar. This will let the IDE check your code and compile both the Unit and project files and link them together. You can also use the Run menu from the top to run your application.
2. You should see this below in a console application
1 |
Hello C++ Developer |
3. If you get an error, check your code – it’s easy to mistype or have the braces (“}” characters) in the wrong place. Note that C++ is case sensitive, so upper and lower characters should be also same.
4. Then press the F9 key or just click the Run button again
How to compile Modern and Visual C++ Applications?
If you succeed in the steps above and want to know how to compile modern and visual application in C++, you can start with a simple Hello World example with some visual components. These “Hello World” examples are good to understand features of the compiler, IDE and the 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, how to deploy or release.
![RADSIDE01950995 | Embarcadero RAD Studio Delphi C++Builder Blogs The Is The Step by Step Guide To Using A C++ Compiler A small example C++ program](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/RADSIDE0-1950995.png?resize=750%2C422&ssl=1)
Now let’s create a Visual and Modern C++ example in C++ Builder,
- Open C++ Builder or RAD Studio IDE
- Create a new MultiDevice Application in C++ Builder from File->New menu. This will allow you to develop multi-OS C++ apps with FireMonkey UI elements. Or you can create a new Windows VCL Application in C++ Builder. This will allow you develop C++ apps with VCL UI elements.
- Save all units and project files with “HelloWorld_” prefix in a HelloWorld folder.
- Add a Memo (TMemo) and a Button (TButton) from the Palette to your Form. TMemo component is good to display all outputs as in console applications.
- Double click the Button to create OnClick() event, inside that Button1Click event write lines as given in the 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); } |
7. Run project by hitting F9 or click Run with Debugging
The output should be like this.
![2012880 Spotlight Background | Embarcadero RAD Studio Delphi C++Builder Blogs The Is The Step by Step Guide To Using A C++ Compiler The small C++ example program running](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/HelloWorld0-7687976-5475330.png?w=750&ssl=1)
8. If there is error, please check your lines
9. If all is fine then save all project
10. if you check your header file you will see all your objects (Memo, Button etc. ) are automatically defined as below. You don’t need to change anything here
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.
This example below is a modern “Hello World” example on Windows which runs with C++ Builder.
If you want, you can switch to your header file (.h) of your cpp file (.cpp) from the button tabs. Your auto-generated header file of your Multi-Device Application will be shown as below,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#ifndef HelloWorld_Unit1H #define HelloWorld_Unit1H //--------------------------------------------------------------------------- #include <System.Classes.hpp> #include <FMX.Controls.hpp> #include <FMX.Forms.hpp> #include <FMX.Controls.Presentation.hpp> #include <FMX.Memo.hpp> #include <FMX.Memo.Types.hpp> #include <FMX.ScrollBox.hpp> #include <FMX.StdCtrls.hpp> #include <FMX.Types.hpp> //--------------------------------------------------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components TMemo *Memo1; TButton *Button1; void __fastcall Button1Click(TObject *Sender); private: // User declarations public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm1 *Form1; //--------------------------------------------------------------------------- #endif |
![CBuilder11512x5121x72861898695819 | Embarcadero RAD Studio Delphi C++Builder Blogs cbuilder 11 512x5121x 7286189 8695819](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2022/01/CBuilder_11_512x512@1x-7286189-8695819.png?resize=192%2C192&ssl=1)
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.
The latest posts along with more examples and tutorials can be found here on the Embarcadero Blog with this dynamic search https://blogs.embarcadero.com/?s=C%2B%2B and in LearnCPlusPlus.org.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition