Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Microsoft Visual Studio support

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:

In summary, the steps for using Visual Studio are:

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.


Microsoft Visual C++ 6

To use Visual C++ 6:

  1. Start a command line prompt

  2. 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.

  3. 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.

[Top]


Microsoft Visual Studio .NET2003

To use Visual Studio .NET2003:

  1. Start a command line prompt

  2. 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.

  3. 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.

[Top]


Limitations

  1. 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.

  2. 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.

  3. 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.

  4. 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.