Chapter 5. C⁠+⁠+ Development

Table of Contents

Introduction
Prerequisites
Creating a C⁠+⁠+ Project
Editing C⁠+⁠+ Code
The C⁠+⁠+ Editor
Include Browser View
Outline View
Type Hierarchy View
Building the Project
Basics
Console View
Problems View
Configuring the Project
Configuring the Build Process
Managing Build Configurations
Configuring the Project Build System
Configuring Makefile Generation for a Folder
Project References and Makefile Generation
Project Features
Motivation
What is a Project Feature
The Project Features Dialog
What Happens When You Enable/Disable a Feature
Using Features from Command Line
The .oppfeatures File
How to Introduce a Project Feature
Project Files

Introduction

The OMNeT⁠+⁠+ IDE contains editors, views and other tools to assist you while developing your C⁠+⁠+ code. C⁠+⁠+ files open in the IDE in the C⁠+⁠+ source editor. The C⁠+⁠+ source editor supports syntax highlighting, documentation tooltips, content assist, automatic indentation, code formatting, refactoring, and several other useful features. The IDE also allows you to configure the build, start the build process, launch simulations, and debug the model without leaving the IDE.

Most of these features are provided by the Eclipse CDT (C/C⁠+⁠+ Development Tooling) project (http://eclipse.org/cdt). This chapter briefly explains the basics of using CDT for developing simulation models. If you want to learn more about how to use CDT effectively, we recommend that you read the CDT documentation in the IDE help system (Help/Help Content).

The OMNeT⁠+⁠+ IDE extends CDT with the following features to make model development easier:

  • A new OMNeT⁠+⁠+ project creation wizard allows you to create simple, working simulation models in one step.
  • Makefiles are automatically generated for your project based on the project build configuration. The built-in makefile generator is compatible with the command line opp_makemake tool, and features deep makefiles, recursive make, cross-project references, invoking the message compiler, automatic linking with the OMNeT⁠+⁠+ libraries; and can build executables, shared libraries or static libraries.
  • Makefile generation and the project build system can be configured using a GUI interface.
  • Project Features: Large projects can be partitioned into smaller units which can be independently excluded or included in the build. Disabling parts of the project can significantly reduce build time or make it possible to build the project at all.