The Standard C++ and Boost Libraries
Examples for Standard C++ Libraries

Examples for Standard C++ Libraries

Table of Contents

Hello World
MMP File for Hello World
Source Code for Hello World

 


Hello World

This example illustrates how to get started with development using Standard C++ using, main() as an entry point for the application. The application prints "Hello World" onto the console.

 


MMP File for Hello World

The MMP file for Hello World is as shown below:

TARGET			opencpphelloworld.exe
TARGETTYPE		exe
UID			0 0xE8212C84
USERINCLUDE		..\inc
SOURCEPATH		..\data
START RESOURCE		opencpphelloworld_reg.rss
#ifdef WINSCW
TARGETPATH		\private\10003a3f\apps
#else
TARGETPATH		rivate\10003a3f\import\apps
#endif
END //RESOURCE
SOURCEPATH	  	..\src
SOURCE		  	opencpphelloworld.cpp

SYSTEMINCLUDE	  	\epoc32\include 
SYSTEMINCLUDE		\epoc32\include\stdapis
SYSTEMINCLUDE		\epoc32\include\stdapis\sys
SYSTEMINCLUDE		\epoc32\include\stdapis\stlport
SYSTEMINCLUDE		\epoc32\include\stdapis\stlport\stl

STATICLIBRARY		libcrt0.lib
LIBRARY			libstdcpp.lib
LIBRARY			libc.lib
LIBRARY			libpthread.lib
LIBRARY			euser.lib

OPTION CW -wchar_t on
MACRO  _WCHAR_T_DECLARED

 


Source Code for Hello World

#include <iostream>
#include <cstring>
 // This is a GCCE toolchain workaround needed when compiling with GCCE
// and using main() entry point

#ifdef __GCCE__
#include <staticlibinit_gcce.h>
#endif
using namespace std;

class myclass {
public:
  void show(){cout<<"Hello World\n"; }
};

int main()
{
  myclass obj;
  obj.show();
  cout<<"Press a character to exit!";
  int c = getchar();
  return 0;
}

Give feedback of this article


ŠNokia 2008

Back to top


This material, including documentation and any related computer programs, is protected by copyright controlled by Nokia. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior written consent of Nokia. This material also contains confidential information, which may not be disclosed to others without the prior written consent of Nokia.

Nokia is a registered trademark of Nokia Corporation. S60 and logo is a trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other company and product names mentioned herein may be trademarks or tradenames of their respective owners.