An integrated development environment, or 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, a full C++ Compiler and IDE is really important because it has specialized features like syntax highlighting, 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
1. Start with downloading the Free C++ Builder Community Edition IDE
C++ is a 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 IDE like RAD Studio 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.
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.
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
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.
2. Learn the various parts and features of a good C+ IDE
C++ Builder IDE has mainly 5 Parts, the Code Editor Window and Form Designer, Projects Window, Palette Window, Structure Window, Object Inspector Window. You can find more, less commonly used windows, from the main IDE menu as well as the right-click context menus. All the basic sections can be summarized in this IDE picture.
Now let’s explain each of these areas shown above.
1.The Code Editor and Form Designer: The Code Editor and the Form Designer occupy the center pane of the IDE window. The Code Editor is a full-featured, customizable UTF8 editor that provides syntax highlighting, multiple undo capability and context-sensitive help for language elements. You can switch between them by using F12 or from lower tabs in IDE. As you design the user interface for your application, RAD Studio generates the underlying code. When you modify object properties, your changes are automatically reflected in the source files.
2. The Project Window : The Project Window displays and organizes the contents of your current project group and any project it contains. You can perform many important project management tasks, such as adding, removing, and compiling files. The default location of the Projects window is the upper right corner of the IDE, but the window is dockable, as are many windows in the IDE
3. The Tool Palette Window: The Tools Palette Window has UI elements, components that can be used in application UI design, it assists with a new project, adds components to a form, or adds code snippets to the Code Editor.
4. The Structure Window: The Structure View Window displays a tree diagram that shows the hierarchy of elements in the active window (that is, the Code Editor or the Form Designer)
5. The Object Inspector Window: The Object Inspector is used to examine and edit the properties and events for the currently selected object or objects. Every design object (Components, UI Elements) can be edited by clicking on it then setting its properties and events in the Object Inspector Window.
Compiling & Running C++ Code: You can Compile and Run your code by pressing F9 or Run button on the top bar. You can use other Run Without Debugging. There is a Stop and Pause button if your code gets stuck in a never-ending loop – a common beginner’s error, don’t worry we’ve all done it! At run time you can use debug, break points, watch variables and many other runtime features.
Switching between the Design and Code View: You can press F12 to switch between the Code Editor and Form Designer. The latest C++ Builder also allows you to use both of them together in the same screen. You can switch code, header and design view from the bottom top bars.
Switching Between the Code Files: You can use tabs on the top to switch between .c or .cpp files and .h headers.
3. How to create a new C++ Project with a GUI?
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.
In C++ Builder, choose File->New-> “Multi-Device Application – C++ Builder” menu.
This will create a New C++ Project for Windows and can be easily compiled for other operating systems like iOS, Android. This will allow you develop C++ apps with FMX UI elements. If you don’t need UI Elements, this means you don’t need VCL or FMX frameworks, you create a console application too. Modern applications have a GUI and skinned Styles. Note that VCL projects are Windows only and FireMonkey projects are Multi Device (multi-platform) applications that you can compile and run on Windows, MacOS, iOS and Android.
Save all Unit files and Project file to a folder.
4. Design your form with UI elements
Simply drag and drop components from the Palette window on the right side; Memo (TMemo) and Button (TButton) to your form design. Arrange their width, height and position. You can edit each of their properties from the Object Inspector on the left side.
Note that you can switch between the GUI Design mode to Code Mode by pressing F12, or vice versa.
5. Add your C++ code
Double click to Button1 to create OnClick() event for this button. Add these lines into Button1Click() event,
String str = "Hello World";
This example above is a modern “Hello World” example for Windows which runs with C++ Builder. Here is a full screenshot of this example,
6. Compile your C++ project and run
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.You should see this below as a form application
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. Then press the F9 key or just click the Run button again.
From this point, you can add more codes or you can switch back to design mode by pressing F12. And you can add more components, then more codes. This is how modern C++ coding works with an UI Toolkit.
If you succeed in the steps above and want to know how to compile modern and visual application in VCL, you can do same with a VCL application. Note that VCL applications are only for Windows operating system, you can not compile for other operating systems. There are slight changes between VCL and FMX components.
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.