Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How can I define macros for the .mmp file on Symbian?

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 2nd Edition (initial release)
S60 1st Edition
Article
Created: User:Technical writer 2 (05 Mar 2003)
Last edited: lpvalente (07 May 2014)

Overview

How can I define macros for the .mmp file?

Description

Is it possible to define macros on the command line so that they can be used in .mmp, .pkg, resource, and C++ files?

Solution

Macros used in C++ files can be defined using the MACRO keyword in the .mmp file. However, those macros are only used by the C++ precompiler. It is not possible to define macros in the command line to be used with bldmake and abld script.
To define global macros that can be used with .mmp, resource, and C++ files, you can create a header file.
--- macros.h ---
#ifndef MACROS_H
#define MACROS_H
#define MACRO1
#define MACRO2
#endif
--- macros.h ends ---
The header file can be included in .mmp, .rss, and C++ files and macros can be used as usually:
#if defined(MACRO1)
  ...do something
#else
  ...do something
#endif
Unfortunately .pkg files use a different syntax and header files cannot be included. See the SDK Help for "Package file format .pkg".

This page was last modified on 7 May 2014, at 12:59.
88 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×