Examples for Standard C++ Libraries |
|
|
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.
|
|
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
|
|
#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;
}
| ©Nokia 2008 |
|