Friday, October 3, 2008

Compiling Program for Symbian OS using Visual C++ 6.0 Introductory Edition

Tools Required



  1. Visual C++ 6.0 Introductory Edition


  2. SDKs




    • s60_2nd_sdk


    • s60_2nd_fp2_sdk_msb




  3. ActivePerl-5.6.1 or higher


  4. JDK 1.6 or higher




OS

Windows XP

Tips

Make sure all the programs are installed in same drive

There is no space in the SDK's folder name
When you add some thing to environment variable always use ";" as separator

Steps



  1. Install Visual C++ 6.0


  2. Install Perl 5.6.1


  3. Install JDK


  4. Configure the path and environment variables




    • Open My Computer > Properties Advanced > Environment Variables > System variables


    • Add C:\Program Files\Java\jdk1.6.0_04\bin to the PATH variable.(for my case you give yours jdk's bin path)


    • Add .pl to PATHEXT variable if it exists and if it doesnot create a variable PATHEXT and add *.exe;*.pl( exe for internal commands and external commands to work)


    • Copy the user variable's path (i.e. one on the top) and add to the system variable's path (i.e. one at bottom).It is very important otherwise later when we will compile our program it will show link.exe missing.



  5. Perl setup usually associates perl scripts with perl. To check, My Computer > Tools > Folder Option > File Types. Go to pl extension, n check if it is setup. if not, create a new and make it to open with perl.exe


  6. Now Test Java and Perl Go To run > cmd >


    • Type java -version and see the output it must give the version of java installed

    • Similarly type perl -version

    • If its working then proceed further if not check environment variables



  7. Now install sdk 2nd edition. the only reason to install this is for visual c++ 6 integration. there are two folders inside C:\Symbian\7.0s\Series60_v20\Series60Tools named 'applicationwizard' and 'epoctoolbar'.Copy them to some other location. we need this later.


  8. Now uninstall the 2nd edition sdk. this sdk has a problem that the gui softwares need exactly 1.3.1 version of java and cant work with higher

  9. Now Install any higher version of sdk (in our case, 2nd ed, fp2). higher versions usually have more examples and better documentations.

  10. Add application wizard and epoctoolbar from 'applicationwizard' and 'epoctoolbar' folders we copied before. Instruction on how to install is given in the readme file in the folders.

  11. Now go to run > cmd and type epoc and see if emulator opens if it doesnot open there is sdk is not installed properly so re-install sdk and follow the steps mention previously

  12. Now create a project either from emulator directly or you can use visual c++. but both of them should create project in same workspace. Defaulf workspace is X:\Work (X = drive where sdk is installed).

  13. .Start Visual C++ 6.0 and create an application using a wizard. Suppose the application is named Helloworld and is located at c:\Work\HelloWorld. Once the files are created, you can edit it, but lets first compile it

  14. To complie either we can use visual c++ or command line


    • To compile from visual c++ go to build and build app

    • For command line Go To Run > cmd


      1. Go to project's group folder. cd c:\Work\Helloworld\group

      2. type "bldmake bldfiles"

      3. to compile for emulator type, abld build wins udeb

        • Meanings:


        1. abld - build utility command

        2. build - build the program

        3. wins - for emulator

        4. udeb - debug build (u means unicode)







  15. Run emulator (debug) from emulator (in start menu > all applications > sdk). there is the compiled application at the bottom of the screen in emulator

  16. to compile for cell phone type,



    • abld build thumb urel or

    • abld build thumb udeb


  17. You will see few errors during compilation,this is because visual c++ we are using doesnot allow to create standalone application.


    • Go to X:\Work\HelloWorld\inc\ and create file a header file "BkCreate.h

    • And write following lines in it1

    • dfkjkdasjkldsa
    • Now go to src folder and edit helloworldapp.cpp file

    • Add include "BkCreate.h" below the line include...

    • Now compile you will see 0 errors.


  18. now go to X:\Symbian\8.0a\S60_2nd_FP2\Series60Tools\install folder n type makesis helloworld.pkg

  19. helloworld.sis is created. transfer this to the mobile phone, install n run..

  20. Now migrane is over so enjoy!!!


No comments: