|
||
The Microsoft Visual Studio IDE can be used to compile and debug applications built for Symbian OS v9.2 and above. The two versions of Visual Studio supported are:
Visual Studio 6
Visual Studio .NET 2003
In summary, the steps for using Visual Studio are:
Make sure that your program has a bld.inf file and a mmp project file.
Use the Symbian OS bldmake and
abld command to create a Visual
Studio project file from the mmp
file.
Open the created Visual Studio project file in the IDE, and build, run, and debug the program from there.
The underlying compiler used for the Visual Studio support is the Nokia
x86 standalone compiler, version 3.2.3. This compiler is provided on Symbian OS
kits in the epoc32
tree under
epoc32/tools/nokia_compiler/
. Note that the C++ compiler supplied
with Microsoft Visual Studio itself is not used.
The Visual Studio support uses the operating system binaries that are
created for the winscw
platform. Support is provided by the
introduction of two build targets, called vs6
and
vs2003
.
To use Visual C++ 6:
Start a command line prompt
Run the Visual Studio environment configuration batch file,
vsvars32.bat
, which is part of your Visual Studio installation.
This ensures that the necessary Visual Studio environment variables are set up.
Change directory to the directory that contains your program's
bld.inf
file, and use the following commands:
> bldmake bldfiles
> abld makefile vs6 [project-name]
The vs6
argument here specifies to the tools that
Visual C++ 6 project files should be produced. The project name is optional. If
it is not mentioned, Visual Studio project files are created for all projects
specified in the bld.inf
file.
These commands creates a Visual C++ workspace (.dsw
) file
generated under the kit's
epoc32\build\<SOURCE_PATH>\<PROJECT_NAME>\WINSCW
directory. For example, if the kit is installed in \Symbian\9.2\
,
and the project is helloworld
, then the .dsw
file is
created in the directory
\Symbian\9.2\epoc32\build\src\helloworld\helloworld\winscw
.
The workspace can then be opened in the IDE, and the project built and debugged from there.
To both build the project and create the workspace, use the commands:
> bldmake bldfiles
> abld build vs6 [udeb | urel] [project-name]
The vs6
platform can optionally be added to the
prj_platforms section in the
bld.inf
file. If this is done, abld
commands will use
the vs6
target without it being explicity specified.
To use Visual Studio .NET2003:
Start a command line prompt
Run the Visual Studio environment configuration batch file,
vsvars32.bat
, which is part of your Visual Studio installation.
This ensures that the necessary Visual Studio environment variables are set up.
Change directory to the directory that contains your program's
bld.inf
file, and use the following commands:
> bldmake bldfiles
> abld makefile vs2003 [project-name]
The vs2003
argument here specifies to the tools that
Visual Studio .NET2003 files should be produced. The project name is optional.
If it is not mentioned, Visual Studio files are created for all projects
specified in the bld.inf
file.
These commands create a Visual Studio solution file (.sln
)
file generated under the kit's
epoc32\build\<SOURCE_PATH>\<PROJECT_NAME>\WINSCW
directory. For example, if the kit is installed in \Symbian\9.2\
,
and the project is helloworld
, then the .sln
file is
created in the directory
\Symbian\9.2\epoc32\build\src\helloworld\helloworld\winscw
.
The solution file can then be opened in the IDE, and the project built and debugged from there.
To both build the project and create the workspace, use the commands:
> bldmake bldfiles
> abld build vs2003 [udeb | urel]
[project-name]
The vs2003
platform can optionally be added to the
prj_platforms section in the
bld.inf
file. If this is done, abld
commands will use
the vs2003
target without it being explictly specified.
If you add a source file into the project directly from Visual
Studio, the source file is not included in the build process. You
must add the source file to the mmp
project file, and then repeat
the abld makefile
step to recreate the workspace.
There is no Edit-And-Continue support on the makefile project when debugging. This means that if you edit a file while debugging, you will have to exit the debugging session, rebuild the project, and then restart debugging session.
If the project produces an EXE, and that EXE already exists, then when the debugger is started, Visual Studio doesn't call Make to check if all targets are up-to-date, but directly starts the program. So, to ensure that all targets are up-to-date during a debug session, a build should be done first before using the debugger.
In .NET2003, a problem sometimes seen is that the Build
Solution
command doesn't build the projects included in that
solution, while the Build <project name>
command
builds correctly. This occurs when the Visual Studio program
uuidgen.exe
is not available in the path. Executing
vsvars32.bat
usually sets up the appropriate path.