Starting from Scratch

 

The asterisk notes are the author’s comments. This was written for the Windows configuration with a Palm III, using CodeWarrior Lite as recent as 6/14/2001.

 

Project Initiation

 

1. Install CodeWarrior Lite IDE for Palm 

* the 'for Palm' part is important.

 

2. Start CodeWarrior

 

3. Start a new project

Go to the menu ‘File’ à  'New…'

 

4. Choose the type of project

A dialogue will pop up to let you choose the type of project.

* I am dealing mainly with Palm OS 3.1. I'm presuming you want to deal with the basic abilities of the Palm, hence choosing Palm OS 3.1 would be a good starting point.

 

5. Name your project

Give this project any title, this will be the title of your *.mcp file and the application you develop.

 

6. Press OK

This will create a new directory on your harddrive with the same name as your project. Within this directory you can and should store your code and any resources within the appropriate folders.

 

7. Inside the CodeWarrior program there should also appear a small window titled MyProject.mcp (an example) - this is your project!!

 

8.  Within this project window, there should three tabs, right under the title bar. Most likely you will start off looking at the ‘Files’ sub window. Within this sub window, you should see two folder icons. One is named AppSources and the other is AppResources.

 

AppSources: This is where all code files and libraries must be listed.

* You must include any file that you want compiled within the project window. it makes sense to put it within AppSources. To add a file (like your C or C++ code) to this folder, look to step 10.

 

AppResources: This is the equivalent to AppSources, except all files within this folder must be of the extension *.rsrc .

 

The project encapsulates for CodeWarrior everything that is needed to compile and make the final application. Hence the need for listing all necessary headers and or class files, except for files like Pilot.h, which the compiler already has, access to.

 

 9. When your project is first initiated, you will more than likely also get a 'Starter.c' file within the AppSources folder, a 'Starter.rsrc' file within the AppResources folder and the StarterCode.Lib file. You should look at the Starter.c file to learn the inner workings of Palm. This startup code actually has a lot of bare bone functions and structures for you to copy. Some of this code, like the PilotMain function, the EventLoop, and the EventHandler, you must have within you code. You don't need exactly all the code, but at least something like it.

* You don’t need the exact PilotMain function given, but at least a PilotMain function defined within your code. Its part of the contract you have to fill.

 

 

Adding Files to Project

 

 10. You can start your code from scratch or add code that already exists.

a1) Go to 'Project'à ‘add Files’.

A dialogue will pop-up. You can choose a file that already exists and also choose to add that file to your project.

a2) Otherwise, you can start from a blank file. ‘File’à’New txt file’

 

11. You can also drag and drop files to arrange or change the project, as you like.

 

Compiling – Setting System Paths

 

 12. The access paths for the compiler were not set correctly and there seemed to be missing libraries! One needs to look at the 'target settings':

a) Go to 'Edit' à '[your_application_name] Settings'.

                        A new dialogue panel should pop up.

b) Look for "Access paths" under "Target" in the tree on the left side of the panel.

c) Once there, look in the right half of the panel near the top and press the "System Paths" radio button. You should see some options listed that look like "{Compiler}..."

d) Make sure that you 'add' a system path to the folder "Palm OS Support" or something similar (depending if you are using the support include with CodeWarrior or the Palm OS SDK).

*The folder "Palm OS 3.1 Support" should be within the "CodeWarrior Lite folder if you installed CodeWarrior Lite.

 

Specifically for  the PenFollow program:

e) The PenFollow program, which can be downloaded from our website, requires the "MSL Runtime Palm OS (2i).Lib" library, which CodeWarrior Lite did not seem to have. I downloaded the Palm OS SDK from the Palm website and installed it. It had all the libraries I needed and was able to compile after setting another system path to the SDK's "Palm OS Support" files for all the necessary libraries.

* Originally I had 201 errors before changing any settings. Once I made sure the system paths were correct, the only error I received was that the compiler could not find the math library (MathLib.h and MathLib.c), which I later added to my project. As far as these extraneous libraries that should have been included, they will be made downloadable from our website. No point in downloading the entire Palm SDK just for a few libraries. Careful, if you do download the SDK, make sure not to set systems paths for the compiler to look within the entire SDK. The compiler will find many of the libraries that are already include with CodeWarrior, and hence you will get redefinition errors when you compile.

 

 12. Make

When you have your resource file and code ready, you must compile and make your code. Assuming you get all the settings correct and you have the properly formatted code for the Palm, you can make your code.

a) You can compile code by going to 'Project' à 'Compile' or right clicking on the file within the project window and choose to compile.

b) To make the actual application, go to 'Project' à 'Make' menu as well. This will produce a '*.prc' file in your working directory. This *.prc file can be uploaded to the Palm (PPRK).

 

Testing your Code

 

 13. P.O.S.E.

 When you actually get past step 12, you should first test your program on the Emulator (POSE) included with CodeWarrior Lite to avoid serious runtime errors.

*  I recommend downloading the Emulator from the Palm website and replacing the CodeWarrior's version of the Emulator as the downloaded Emulator is more complete and supports more Palm platforms. I had to do this to test my Palm IIIc. Pre-testing your code on the Emulator has the benefit of checking if you have all the proper functions and OS system calls.

 

 

 

Please send any comments, suggestions to the following address:

 

Bryan Valentini

bev@andrew.cmu.edu

 

Additional steps for other systems are welcomed.