Namespaces
Variants
Actions

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

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (05 Mar 2003)
Last edited: hamishwillee (14 Jun 2012)

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 14 June 2012, at 08:58.
94 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved