One of a typical issue when developing a Symbian application, is to adapt it to several platforms.
Until last year, things were clear:
Developers targeting the Nokia devices had to use the Nokia Series 60 v1.x SDK and any Symbian enabled IDE since they finally all had their own version of the Nokia SDK (Visual Studio, Metrowerks Codewarrior and Borland C++Builder).
Developers targeting the SonyEricsson device had no choice and must use the SonyEricsson/UIQ 2.0 SDK alongst with Metrowerks CodeWarrior.
Note: I am not mentionning alternatives like Linux based environment since they are (unfortunately) not mainstream environments for Symbian development.
With the arrival of Series 60 v2.0, Series 90 and UIQ 2.1 platforms, things are becoming a little bit more complex since the number of SDKs are increasing rapidly. Not to mention the Siemens SX1 SDK, Sendo SDK,... It now becomes quite common to have several SDKs installed on a single machine (as far as I am concerned, I commonly use Nokia Series 60 v1.2, Nokia Series 60 v2.0 and UIQ v2.1 SDKs).
Furthermore, users of Visual Studio and Borland C++Builder do not have to move to Codewarrior to enjoy UIQ development anymore. So, a proper configuration of all these tools has become a necessity (and -until recently- a real pain).
As a matter of fact, not all the SDKs use the same method to configure themselves:
Symbian 6.1 based SDKs (all Series 60 v1.x SDKs) use the EPOCROOT environment variable
Symbian 7.0/7.0s SDKs (UIQ, Series 60 v2.0 and Series 90) rely on the new - and not so easy to use - device command.
The EnvironmentSwitch tool
Happily enough, Nokia delivers with its latest SDKs (NS60 v2.0 and NS90 v1.0beta) a small utility program called EnvironmentSwitch that is really useful to achieve succesful cohabitation of all SDKs (even non-Nokia ones). This tool is located by default in
C:\Symbian\7.0s\Series60_v20\Series60Tools\environmentswitch
or
C:\Symbian\7.0s\Series90_v10b_CW\Series90Tools\environmentswitch
Two files are required to run the tool [1] :
environmentswitch.exe which is the tool executable
settings.xml which is the configuration file.
This settings.xml file is the key to configure your system properly. EnvironmentSwitch looks for it in the following places:
the full path (directory and filename) specified by a single command line argument, else
the full path (directory and filename) specified by the environment variable ENVSWITCHCONFIG, else
a file named settings.xml in the directory from which it is launched.
Once started, a small yellow icon will appear on your taskbar waiting for you to select your working SDK.
The EnvironmentSwitch configuration
The configuration file is in a simple attribute-based XML format. An example is shown at the bottom of this page.
The document root element type is settingsfile. It has no attributes.
All child elements of the root are of type environment. Each environment element is typically use to define a new SDK configuration.
An environment element has the following attributes:
- name (mandatory) - the menu item caption
- icon (optional) - .ico file for the tray icon when this environment is selected - like old EPOCICON
- tooltip (optional) - tooltip text when this environment is selected - defaults to value of name
Child elements of an environment element are of type env or command.
The env element modifies an environment variable:
- key (mandatory) - the variable to modify
- value (optional) - the value
- action (optional) - how it modifies current value
- " prepend "
- " append "
- " replace " (default) Note: use "replace" with no value to unset a variable.
- registry (optional) - if "yes", modify the current control set in the Registry to affect other processes (default is "no")
The environment variables (including the Registry) are restored this when environment is deselected (or EnvironmentSwitch terminates).
The command element specifies a command to execute:
- value - the command (mandatory)
- directory - (optional) working directory in which to invoke it - extends old PROJECTPATH
- binding - (optional) when to execute, defaults to "entry":
- " entry " - run when this environment is selected
- " exit " - run when this environment is deselected (or EnvironmentSwitch terminates)
- " middlebutton " - run on middle mouse button click
- " doubleclick " - run on left mouse button double click
- " menu " - attach to the EnvironmentSwitch (right mouse button) menu
- outputwindow - (optional) if "yes", capture any command output (stdout & stderr) to an error message box - intended to support 'devices -setdefault'
- caption - (optional) menu item caption if binding is "menu", ignored otherwise. Default is to use the value attribute
Example Configuration File
Here is the settings.xml file I use:
<?xml version="1.0" standalone="yes"?>
<settingsfile>
<!-------------------------------------
-- Symbian 6.1 / Series60 v1.2 SDK
------------------------------------>
<environment name="Series60 v1.2">
<env key="PATH" action="prepend" value="C:\Symbian\6.1\Series60\Epoc32\Tools\;"/>
<env key="PATH" action="prepend" value="C:\Symbian\6.1\Shared\Epoc32\Tools\;"/>
<env key="PATH" action="prepend" value="C:\Symbian\6.1\Shared\EPOC32\gcc\bin\;"/>
<env key="PATH" action="append" value=";C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin"/>
<env key="EPOCROOT" action="replace" value="\Symbian\6.1\Series60\"/>
<command value="cmd.exe /k title Series60 v1.2" directory="C:\Symbian\6.1" binding="middlebutton"/>
<command value="cmd.exe /k title Series60 v1.2" directory="C:\Symbian\6.1" binding="menu" caption="Shell"/>
<command value="cmd.exe /k title Series60 v1.2" directory="C:\Symbian\Projets" binding="menu" caption="Projets"/>
<command value="epoc.exe -wins" binding="menu" caption="EPOC emulator"/>
<command value="msdev.exe" binding="menu" caption="VC++ 6.0"/>
<command value="C:\CBuilderX\bin\CBuilderW.exe" binding="menu" caption="C++BuilderX"/>
</environment>
<!-------------------------------------
-- Symbian 7.0s / Series60 v2.0 SDK
------------------------------------->
<environment name="Series60 v2.0">
<env key="PATH" action="append" value=";C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin"/>
<env key="PATH" action="prepend" value="C:\Program Files\Fichiers Communs\Symbian\Tools\;" registry="yes"/>
<command value="devices -setdefault @Series60_v20:com.nokia.series60" binding="entry" outputwindow="yes"/>
<command value="cmd.exe /k title Series60 v2.0" directory="C:\Symbian\7.0s\Series60_v20" binding="middlebutton"/>
<command value="cmd.exe /k title Series60 v2.0" directory="C:\Symbian\7.0s\Series60_v20" binding="menu" caption="Shell"/>
<command value="cmd.exe /k title Series60 v2.0" directory="C:\Symbian\Projets" binding="menu" caption="Projets"/>
<command value="epoc.exe -wins" binding="menu" caption="EPOC emulator"/>
<command value="msdev.exe" binding="menu" caption="VC++ 6.0"/>
<command value="C:\CBuilderX\bin\CBuilderW.exe" binding="menu" caption="C++BuilderX"/>
</environment>
<!-------------------------------------
-- Symbian 7.0 / UIQ v2.1 SDK
------------------------------------->
<environment name="UIQ v2.1">
<env key="PATH" action="append" value=";C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin"/>
<env key="PATH" action="prepend" value="C:\Program Files\Fichiers Communs\Symbian\Tools\;" registry="yes"/>
<command value="devices -setdefault @UIQ_21:com.symbian.UIQ" binding="entry" outputwindow="yes"/>
<command value="cmd.exe /k title UIQ v2.1" directory="C:\Symbian\UIQ_21" binding="middlebutton"/>
<command value="cmd.exe /k title UIQ v2.1" directory="C:\Symbian\UIQ_21" binding="menu" caption="Shell"/>
<command value="cmd.exe /k title UIQ v2.1" directory="C:\Symbian\Projets" binding="menu" caption="Projets"/>
<command value="epoc.exe -wins" binding="menu" caption="EPOC emulator"/>
<command value="msdev.exe" binding="menu" caption="VC++ 6.0"/>
<command value="C:\CBuilderX\bin\CBuilderW.exe" binding="menu" caption="C++BuilderX"/>
</environment>
</settingsfile>
This file configures three SDKs [2]:
a Series 60 v1.2 SDK (located in C:\Symbian\6.1\Series60\)
a Series 60 v2.0 SDK (located in C:\Symbian\7.0s\Series60_v20)
a UIQ v2.1 SDK (located in C:\Symbian\UIQ_21)
For each SDK, I use the following command set:
a command that opens a shell to the root of the SDK
a command that opens a shell to my projects root directory
a command that starts the selected SDK EPOC emulator
a command that starts Visual C++ 6 IDE
a command that starts Borland C++BuilderX IDE
[1] You may also need to update your system by installing MSXML Core Services 4.0 SP2 to get rid of a warning at program startup.
[2] Note that some of the lines are specific to my french Windows configuration. To reuse the file, you will probably have to modify each path that contain C:\Program Files\Fichiers Communs to something more suitable to your system (probably C:\Program Files\Common Files.
> Using multiple SDKs
hi.. I have modified the settings, pretty much like you did. It works when i issued command "abld build thumb urel" or" abld build wins udeb" on series60 v2.0, but when i changed the setings to series60 v1.0, the command didnt working and showed : \Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\EXPORT.make:3: *** missing se parator. Stop.
What's wrong whit it. Please help.... make -r -f "\Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make" MAK EFILE VERBOSE=-s \Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make:6: *** missing sepa rator. Stop. make -r -f "\Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make" LIB RARY VERBOSE=-s \Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make:6: *** missing sepa rator. Stop. make -r -f "\Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make" RES OURCE CFG=UDEB VERBOSE=-s \Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make:6: *** missing sepa rator. Stop. make -r -f "\Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make" TAR GET CFG=UDEB VERBOSE=-s \Symbian\7.0s\Series60_v20\EPOC32\BUILD\MOKA\GROUP\WINS.make:6: *** missing sepa rator. Stop.
Whats wrong whit it? please help..
> Using multiple SDKs
> Using multiple SDKs
Ok, first i used the AppWizard v2.0 to create a project. Then it gives me an error, that it cant insert my project. No why is it epoc32 in lower case e ... where do i set that ? Error:
c:\Symbian\6.1\Series60\epoc32\build\Devel_2\test123\group\test123\wins\test123.dsw The specified project could not be inserted into the current workspace.
Ok, it still creates the file, if i do explorer, then right click on MMP file select "Create VC Workspace" it gives me in cmd.exe this error Error:
EPOCROOT environment variable must be capitalised BEGIN failed--compilation aborted at C:\Symbian\7.0s\Series60_v20\epoc32\tools\/E32env.pm line 51. Compilation failed in require at C:\Symbian\7.0s\Series60_v20\epoc32\tools\bldmake.pl line 27. BEGIN failed--compilation aborted at C:\Symbian\7.0s\Series60_v20\epoc32\tools\bldmake.pl line 27. 'abld' is not recognized as an internal or external command, operable program or batch file.
Now im using Win2k -SP3, VC++ 6 SP5, right version of perl, and everything is fine, my settings file is correct etc. I dont know what to do with this, any ideas ?
Thx.