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


Back to top


Copyright ©2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.