Tutorial Part 1: Compiling

Up: GEOS SDK TechDocs| Up | Next: Tutorial Part 2: A New Application

Before jumping into writing your own application, it might be useful to compile and run an existing sample application. This chapter will take you through the generic steps of checking out a source file, compiling it, then running the compiled application on the emulator with the Swat debugger attached. The next two chapters explore GEOS development in greater detail by stepping through every step in creating the application "Tutorial". We recommend that you step through this chapter to acquaint yourself with the generic process of compiling an application, then carefully follow the tutorial to get a flavor for GOC, Swat debugging, and Geode Parameter files.

Typically, your development sequence will follow these steps:

  1. Check out a file by copying it to your Working Branch. This is your private development area. By doing your work here, the Branch files remain untouched (see "Developing In Your Working Branch" for more information);
  2. Create a Makefile using the mkmf utility;
  3. Compile your application using the pmake utility;
  4. Run the application on the error-checking version of the target emulator;
  5. Debug your application using the Swat debugger; and
  6. Edit your source code and go back to Step 3.

The next section follows this sequence using the Dialogs sample application, though of course the same steps apply for any sample application. (Refer to the release notes in the README.TXT file or the Troubleshooting guide in the "Installing the SDK" chapter if you encounter problems.)

In the directory paths below, prepend your correct drive letter or path to PCGEOS and replace "workingdir" as appropriate. Also note that if you are using the Nokia 9000i SDK version 2.0, the directory labled here as N9000v11 will be N9000v20 in your development branch.

  1. Install the SDK by following the instructions in the "Installing the SDK" chapter;
  2. Start a command window.
  3. Go to the \APPL\ subdirectory of your Working Directory:
  4. CD PCGEOS\workingdir\APPL
  5. Create and go to the subdirectory \SDK_9000\DIALOGS\:
  6. MD SDK_9000\DIALOGS
    CD SDK_9000\DIALOGS
  7. Copy the file DIALOGS.GOC from the N9000v11 Branch to this directory:
  8. COPY \PCGEOS\N9000V11\APPL\SDK_9000\DIALOGS\DIALOGS.GOC
  9. Type mkmf to create the makefile.
  10. Type pmake to compile and link the executable. This will create an error-checking version called DIALOGSEC.GEO .
  11. Launch a wait-for-swat EC demo. You can do this from the GEOS SDK program menu if the shortcuts were installed; otherwise, CD to \PCGEOS\workingdir\TARGET\N9000.EC, then type start ss .
  12. Launch Swat. You can also do this from the GEOS SDK program menu; otherwise, type start pcgeos\bin\swat . (The full path is only necessary if there is also a Swat stub in your current directory, which you do not want to run.)
  13. When the emulator has finished loading (usually after "serial" exits), press Ctrl-C in the Swat window to bring command control back to Swat.
  14. Copy your geode (your compiled executable) to the target emulator by typing send dialogs .
  15. Type c to continue Swat.
  16. Click inside the emulator window to regain focus in that window. Press Ctrl-F12 to launch the Extras folder.
  17. Use the arrow keys to highlight the EC Dialogs application. Press F1 to launch it. (The keys F1 - F4 correspond to the menu list on the right of the emulator window.)
  18. Play with the application.
  19. Select the Swat window, press Ctrl-C to bring command control back to Swat, then type quit to exit the emulator.

In this section, you learned how to check out a source code file by copying it from the Branch directory to your Working Directory, and then compile and run it on the emulator. Notice that it was not necessary to copy all the files from the \DIALOGS\ subdirectory in the N9000v11 Branch. When compiling and linking, the tools are smart enough to look for files in your Working Directory first and then look for whatever other files it needs in the Branch directory. This allows you to copy only the file or files you need to work on; shared files can remain in the Branch directory.

Now that you've gone through the basic steps of compiling and running a GEOS application, you can go on to the next chapter to create your own application from scratch.


Up: GEOS SDK TechDocs| Up | Next: Tutorial Part 2: A New Application