Sunday, March 15, 2009

Installing and checking the SDK 1.2

Now we can install and check the SDK
version 1.2. I use this for maximum
compatibility (at the time of this
writing it is the oldest available). I own
a Nokia 3660 so I wish to compile
programs compatible with the series 60 platform 1.x. Other SDKs have similar
installation procedures. Unzip n 6 0 _ s d k _ 1 _ 2 . z i p , and then run the contained s e t u p . e x e . Perform the following test to check if it
is working: > c d C : \ S y m b i a n \ 6 . 1 \ S e r i e s 6 0 \ S e r i e s 6 0 E x \ f o r m \ g r o u p > b l d m a k e b l d f i l e s > a b l d b u i l d w i n s u d e b You should expect NO error messages.
Unfortunately, sometimes Perl may not
be able to find an E n v 3 2 . p m file. To fix this problem I simply edited: C : \ S y m b i a n \ 6 . 1 \ S h a r e d \ E P O C 3 2 \ T o o l s \ B L D M A K E . B A T and changed p e r l - S b l d m a k e . p l % 1 % 2 % 3 % 4 % 5 % 6 % 7 % 8 % 9 into: p e r l - I c : \ s y m b i a n \ 6 . 1 \ s h a r e d \ e p o c 3 2 \ t o o l s - S b l d m a k e . p l % 1 % 2 % 3 % 4 % 5 % 6 % 7 % 8 % 9 The problem is that for some strange
reason, some Perl libraries are placed in
a different directory and not in the
default Perl search path. This way, I
simply told the Perl interpreter where
to find the missing E n v . p m. To test if the build works, launch the
emulator, using the icon installed in the
start menu for your SDK. You should see
(as one of the latest icon of the
emulated phone menu) an icon with
the name "Form". Clicking on it will launch the example (that we just
compiled) straight in the emulator.
Enjoy a demo of the available form
options for the Symbian Series 60
platform! Well, if everything is working in the
emulated environment, maybe you are
wondering if things work in the real
one, your phone. You can now check if
you are able to build an installer for a
phone. Run these commands: > a b l d b u i l d t h u m b u r e l > c d . . \ s i s > m a k e s i s You should end with a . s i s file in your directory. Send it to your phone
(by Bluetooth or other means) and if
your phone is SDK 1.2 compatible, the
installation will perform just fine and
the application will run in the same
way it worked in the emulator.

Wednesday, February 11, 2009

Building programs with the SDK

The numerous Symbian SDKs share a
special build system developed by
Symbian for the use specifically with
the SDK. Some of the Symbian IDEs
build on top of it, in order to provide
integration with the SDK. C++BuilderX in particular integrates with the default
build system very well. Although there exist alternative ways
to build things for Symbian (as the
Rudolf König SDK on Unix using plain
GNU Makefile), the Symbian build
system is somewhat standard in the
Symbian C++ world. So I believe that it must be known by every Symbian C++
programmer and I will teach you how
to use and develop applications with it. A Symbian application source usually
stores, in a directory named 'group', the
file 'bld.inf' and one or more files with
extension '.mmp'. You define the build
for your Symbian application by writing b l d . i n f and at least one p r o j e c t . mm p . Then you process these files with a tool named
'bldmake' and will obtain a batch file
('ABLD.BAT') and some makefiles that
will build the application for you. This tool exists mainly because a
Symbian application is usually built for
many platforms: the emulator, using a
Microsoft X86 compiler, as well as the
real device using a gcc-derived ARM
compiler. The b l d m a k e saves you from writing specially crafted makefiles
for these compilers and make utilities;
also it allows for building many targets
with just a single command. In fact, 'bldmake' is quite easy to use IF
you accept the way it works. If you
don't, you will suffer endless
nightmares in order to build things the
way you want. Another drawback is
the fact that it is somewhat slow, so you have to compile, build and start the
emulator, and always wait some time
in the middle of the process. Let's explain how it works with an
example. Open a command line prompt,
and after changing to the directory
containing the b l d . i n f , t y p e : > b l d m a k e b l d f i l e s Of course, you must have the PATH set
correctly for the installation of the SDK
you are using. This command will look
for the b l d . i n f , process it and the related * . mm p , then generate a BATCH file named A B L D . B A T . Now you have all you need to build your
applications. Simply type: > a b l d b u i l d This will build your application in all the
available flavors. Well, in fact you are
building eight (!) different binaries. Note
that the target files are stored in a very
deep directory structure, and you are
building both in debug and release versions for WINS (windows), ARM4
(plain arm), ARMI (speed optimized
arm), THUMB (size optimized ARM)! But
you can choose to build for only one
target, and since it take less time, you
usually build ONLY for one version of one target. For example, to build for the
emulator only in the debug version, or
for the device, optimized for size, in
release version, you type: > a b l d b u i l d w i n s u d e b > a b l d b u i n d t h u m b u r e l Building for Windows is enough to start
the emulator and run the application in
the emulated environment. Application
files are compiled and placed straight
where the emulator can run it: no need
to copy them in the right location. But for real devices, you have to pack
everything in a . s i s file for installation, send it to the phone and
install the application. You are required
to write a . p k g file to describe the installer, and then create it with: > m a k e s i s f i l e . p k g References:
BldMake
ABLD

Submenu
2.1 Binary Files
2.2 Source Files
2.3 The build process
2.4 The .mmp
2.5 The AIF
2.6 Create an installer

Thursday, January 22, 2009

Installing Microsoft tools

Note: we will choose special installation
directories (not the default ones!) in
order to prevent some problems which
can arise if we use the installation
directories containing spaces in file
name (that is the case if we stick with the default suggestion).
Run the installer VCToolkitSetup.exe.
Since installation path containing spaces
can generate problems, I will
recommend that you to install it to a
directory without spaces in the name. Also installing in drives different from C:
can give you some problems, so I
recommend installing it in: C : \ S y m b i a n \ M S D E V This will create c:\Symbian\MSDEV\bin
(and other directories).
Now we can install the debugging
tools, running d b g _ x 8 6 _ x . y . e x e . This installer won't create ANY bin
subdirectories, placing the cdb.exe
(required for the debugging support) in
the top level of the installation
directory. So I suggest you to choose,
(in order to have all the required tools in the same place), this one: C : \ S y m b i a n \ M S D E V \ b i n Now you can install n m a k e , executing nmake15.exe: it will
decompress n m a k e . e x e and n a m a k e . e r r . Copy both of them to C : \ S y m b i a n \ M S D E V \ b i n The next step is to copy l i b . e x e and d u m p b i n . e x e to: C : \ S y m b i a n \ M S D E V \ b i n Now you have to add, to the system (or
user) path, the directory C : \ S y m b i a n \ M S D E V \ b i n . To do so, go to the control panel, choose
system, select advanced and click on
the button 'Environment Variables'.
Depending on your locale, icons and
option names will be translated in your
language. Now you have a dialog. Choose in the System Panel the entry
'PATH' and edit it by double clicking. At
the beginning add C : \ S y m b i a n \ M S D E V \ b i n ; . Note the ';' at the end, it is essential to separate
things. If you forget it, things simply
won't work. As a check, open a
command prompt and type 'nmake'. If
you get 'command not found' or
equivalent, you made a mistake in configuring the path. NOTE: if you get
'makefile not found' or similar, then you
are right: nmake is working (only it
does not find a makefile, but at this
stage it is not supposed to do so).
Congratulations! You have installed the required Microsoft tools for the Symbian
SDK.