This is reproduced in full from my website
OPL Getting Started HOWTO
I spent last weekend working out how to begin developing in OPL for Series 60 and I didn't find it particularly easy. What I really wanted was a quick step-by-step guide on what to do and where to get things; instead I had to rely on what I could find in assorted places on the web. I noted down most of what I did and have managed to remember the rest so I thought why not write a quick and easy guide on what I had to do.
1. Download & install the Nokia Series 60 SDK.
This can be found at:
http://www.forum.nokia.com/main/0,6566,034-4,00.html
I downloaded the 90MB Nokia Version 1.2 option but if you're lucky and you've got a 6600 there's a version 2.0.
Once it had finished downloading unzip the contents of the file and run the setup.exe file. It's a fairly logical install but here are some caveats:
a. The default install location is C:\Symbian. The SDK doesn't seem to like being installed in a path with any spaces in it, neither does it like to be installed on the same drive as any other Symbian (or Psion) SDK's. Since I like to keep the root of my C: drive fairly clean I opted to create a new partition (E: ) and installed it to E:\Symbian. All of the following file locations take this into account so you'll have to update them accordingly if you're following this guide.
b. If you do choose to install it to a different location you'll have to update E:\Symbian\6.1\Series60\Epoc32\Data\epoc.ini. There's a line which begins _EPOC_DRIVE_D which you'll need to update, for instance mine is:
_EPOC_DRIVE_D e:\symbian\6.1\Series60\epoc32\wins\d
If you don't do this then the emulator will start up and display Series 60 on the screen before hanging.
c. If you've got multiple Symbian SDK's on your PC you'll need to make sure the EPOCROOT environment variable is correct when you compile OPL programs for the Series 60. This can be checked and changed in one of two ways. The GUI method is by right-clicking on My Computer and choosing Properties. Then go to the Advanced Tab and choose Environment variables. In the list of system variables you'll see the EPOCROOT value which should be set to \Symbian\6.1\Series60\. If it's not then use the edit button to update it. If you want to use the command line then open up a command prompt and type:
set EPOCROOT
to check the current value. If it's incorrect then simply type:
set EPOCROOT=\Symbian\6.1\Series60\
d. When you install the SDK it says it is only supported on Windows NT. It's shocking that Nokia only support their SDK on an OS Microsoft themselves no longer support (there are several things in the SDK that don't seem to have been touched since Psion released the first version about 5 years ago) but I've had no problems with either Windows 2000 or XP Pro. I can't see why XP Home would be any different but I'm not sure you'll get it to work on Windows ME, 98 or 95. I think I remember reading someone got it working in Linux under Wine but you'll have to look on the web.
Once you've installed and configured the SDK run either of the emulators (debug or release) from your Start menu just to make sure they're working.
2. Download and install the OPL Series 60 developer's package
Choose a mirror and download the 250KB package from:
http://prdownloads.sourceforge.net/opl-dev/OPL-OS61-WINS-025.ZIP?download
There's a readme.txt in the root of the zip file that tells you how to install the package. You basically unzip the \binaries\PC files over the drive you installed the SDK on (so in my case E: ). This will copy all of the required files to the relevant locations.
If you open up the debug emulator and scroll to the bottom of the menu you'll see an application called "OPLTestS..." has appeared. Click on OK to run your first OPL app under emulation.
3. Write your first application
It is possible to write OPL application using the 9200 communicator SDK and copy them across but I'd much rather use a proper Windows text editor and take advantage of all the money I blew on my LCD monitor. You can write OPL programs in any text editor, I prefer ultraedit since I use it at work but notepad is just as capable of doing the job. Open up notepad and type (or if you're lazy copy) the following:
PROC Hello:
gAT 10,60
gPRINT "Hello world"
gAT 10,80
gPRINT "Press any key to exit"
GET
ENDP
This is the traditional beginner's program which simply prints "Hello world" on the screen and then exits when any key is clicked. I've added the gAT commands so that it prints the text on the blank bit of the screen. My first attempts were putting it underneath the OPL title and graphic.
Save this file somewhere as a .tpl file. For instance I saved mine as E:\Projects\Test\hello.tpl
4. Translate/Compile your application
In order to compile the program so we can run it on our phone or emulator we need to use a utility called opltran. There are a number of options for opltran that I found documented in an old Psion SDK. Hopefully the guys at allaboutopl will publish a copy soon. All but one of the options can be ignored for this basic program so just follow the steps below for now.
There is a batch file buried in your Symbian directory at E:\Symbian\6.1\series60\epoc32\tools called opltran.bat that we'll use for this so open a command prompt and change to the drive you installed the SDK on by typing the drive name and a colon (for instance E: ). Then change directory to the location of opltran.bat by typing:
cd \Symbian\6.1\series60\epoc32\tools
In order to compile the program type:
opltran.bat E:\Projects\Test\hello.tpl
where the only argument is the location of your .tpl file from the last step. Assuming you haven't made any errors you'll get the following output:
Opltran v2.09
Translating E:\Projects\Test\hello.tpl
E:\Projects\Test\hello.tpl translated OK
If you look in the same directory as your .tpl file you should find a file called hello.opo. This is your OPL program.
5. Copy the program to the emulator
We now need to copy the file to the emulator's file system. You can test it on your phone (I'll cover this at the end) but if you're going to do this regularly you'll want to do it using the emulator. The emulator's "C drive" or main memory is at:
E:\Symbian\6.1\Series60\Epoc32\Wins\c
so copy your .opo file there.
6. Locate the file using a file explorer
OPL on the Series 60 doesn't currently allow you to create applications that can be run from the menu. In order to do this you need a C++ wrapper the creation of which is well over my head at the moment. In order to run our .opo file we need to install a file explorer application and run the program from there.
Some of the OPL documentation helpfully mentions using FExplorer but I spent ages trying to work out how to install the .sis package I downloaded onto the emulator. It turns out this is not possible so I had to find a WINS build of FExplorer. Luckily there is one at:
http://www.newlc.com/article.php3?id_article=70
Download the zip file and extract it to:
E:\Symbian\6.1\Series60\Epoc32\Wins\c\system\Apps\FExplorer
7. Run it
Open up the debug emulator and there should be an application at the bottom of your menu called (surprisingly) FExplorer. Run this and you'll be presented with a list of all of the emulator's "disks". Select the C drive and the click right on the emulator's joystick. You should now see a number of folders and at the bottom you should find your hello.opo program. Click OK to run the program and hopefully you'll see the following:
Example
Job done.
If you have any questions please feel free to ask and I'll try to help out. However, please remember I've only been using OPL for about a week (though I did use it for about a month years ago) so I'm no expert. Also if you see any errors please send corrections to taprice[at]bigfoot.com and I'll edit this page.
Tom (MkollUK)
A. Testing the application on your phone
As I said above it's possible to test your application on your Series 60 phone. In order to do this you'll need to install a file explorer like FExplorer (this time using the .sis file) and the OPL runtime which is available here:
http://prdownloads.sourceforge.net/opl-dev/OPL-OS61-025.SIS?download
You'll also need an application like PC File Manager from Epocware to get the .opo file onto the phone. If you just send it via Bluetooth the Messaging app doesn't know what to do with it.