Symbian3/SDK/Source/GUID-B5576E47-CBB6-5E50-91BD-1CA1425EACE8.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-B5576E47-CBB6-5E50-91BD-1CA1425EACE8"><title>Microsoft Visual Studio support</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>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: </p> <ul><li id="GUID-4D09A2B0-BB9A-55A1-B52E-31E0B109AF92"><p>Visual Studio 6 </p> </li> <li id="GUID-50BB739A-A7BE-56E5-BDC4-2B567BE1C560"><p>Visual Studio .NET 2003 </p> </li> </ul> <p>In summary, the steps for using Visual Studio are: </p> <ul><li id="GUID-DF940813-C534-5AE6-9694-C1269FD00D3D"><p>Make sure that your program has a <xref href="GUID-7D3B5008-CB40-504D-90A8-92DE482977CA.dita">bld.inf file</xref> and a <xref href="GUID-BBBB5000-90A2-503A-9521-2FC6DEC69DC8.dita">mmp</xref> project file. </p> </li> <li id="GUID-8EF5BC4A-5B7D-59AE-9C90-36474A64C6EB"><p>Use the Symbian platform <xref href="GUID-793A5EF9-CC16-5EEB-9011-6431EA76EB15.dita">bldmake</xref> and <xref href="GUID-B6B54E07-3B34-5D5C-8815-93383FA8FB4B.dita">abld</xref> command to create a Visual Studio project file from the <filepath>mmp</filepath> file. </p> </li> <li id="GUID-18A4779C-B284-5E8F-9648-797200F9B9F2"><p>Open the created Visual Studio project file in the IDE, and build, run, and debug the program from there. </p> </li> </ul> <p>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 platform kits in the <filepath>epoc32</filepath> tree under <filepath>epoc32/tools/nokia_compiler/</filepath>. Note that the C++ compiler supplied with Microsoft Visual Studio itself is <i>not</i> used. </p> <p>The Visual Studio support uses the operating system binaries that are created for the <filepath>winscw</filepath> platform. Support is provided by the introduction of two build targets, called <codeph>vs6</codeph> and <codeph>vs2003</codeph>. </p> <section id="GUID-0446B041-DA7A-5B3E-9BBE-DE15B64CFC14"><title>Microsoft Visual C++ 6</title> <p>To use Visual C++ 6: </p> <ol id="GUID-A37F5384-7F3C-5F37-9B35-C24680DB5F8C"><li id="GUID-7BBFD685-6959-5B46-9776-0786B7E696A4"><p>Start a command line prompt </p> </li> <li id="GUID-069A3C30-8C4F-5271-9310-2205B3A204F2"><p>Run the Visual Studio environment configuration batch file, <filepath>vsvars32.bat</filepath>, which is part of your Visual Studio installation. This ensures that the necessary Visual Studio environment variables are set up. </p> </li> <li id="GUID-F535FA4C-9297-56F7-AF64-E12561DC11AC"><p>Change directory to the directory that contains your program's <filepath>bld.inf</filepath> file, and use the following commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld makefile vs6 [project-name]</userinput> </p> <p>The <codeph>vs6</codeph> 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 <filepath>bld.inf</filepath> file. </p> </li> </ol> <p>These commands creates a Visual C++ workspace (<filepath>.dsw</filepath>) file generated under the kit's <filepath>epoc32\build\&lt;SOURCE_PATH&gt;\&lt;PROJECT_NAME&gt;\WINSCW</filepath> directory. For example, if the kit is installed in <codeph>\Symbian\9.2\</codeph>, and the project is <filepath>helloworld</filepath>, then the <filepath>.dsw</filepath> file is created in the directory <filepath>\Symbian\9.2\epoc32\build\src\helloworld\helloworld\winscw</filepath>. </p> <p>The workspace can then be opened in the IDE, and the project built and debugged from there. </p> <p>To both build the project and create the workspace, use the commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld build vs6 [udeb | urel] [project-name]</userinput> </p> <p>The <codeph>vs6</codeph> platform can optionally be added to the <xref href="GUID-A12A6C54-7E9E-5ECD-A0BF-8F980160A0D2.dita">prj_platforms</xref> section in the <codeph>bld.inf</codeph> file. If this is done, <filepath>abld</filepath> commands will use the <codeph>vs6</codeph> target without it being explicity specified. </p> </section> <section id="GUID-6BAD5FE2-04E6-5477-8D3A-66ED2FCCB4CE"><title>Microsoft Visual Studio .NET2003</title> <p>To use Visual Studio .NET2003: </p> <ol id="GUID-C797613A-E6CD-5FDF-923C-68692EE40B79"><li id="GUID-09F71472-F96E-5B63-ACB0-87CDD318843E"><p>Start a command line prompt </p> </li> <li id="GUID-E34B1487-FECD-5793-ADF3-9F9ECC556FC1"><p>Run the Visual Studio environment configuration batch file, <filepath>vsvars32.bat</filepath>, which is part of your Visual Studio installation. This ensures that the necessary Visual Studio environment variables are set up. </p> </li> <li id="GUID-4F706853-59EC-5FC3-935F-22B513235758"><p>Change directory to the directory that contains your program's <filepath>bld.inf</filepath> file, and use the following commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld makefile vs2003 [project-name]</userinput> </p> <p>The <codeph>vs2003</codeph> 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 <filepath>bld.inf</filepath> file. </p> </li> </ol> <p>These commands create a Visual Studio solution file (<filepath>.sln</filepath>) file generated under the kit's <filepath>epoc32\build\&lt;SOURCE_PATH&gt;\&lt;PROJECT_NAME&gt;\WINSCW</filepath> directory. For example, if the kit is installed in <codeph>\Symbian\9.2\</codeph>, and the project is <filepath>helloworld</filepath>, then the <filepath>.sln</filepath> file is created in the directory <filepath>\Symbian\9.2\epoc32\build\src\helloworld\helloworld\winscw</filepath>. </p> <p>The solution file can then be opened in the IDE, and the project built and debugged from there. </p> <p>To both build the project and create the workspace, use the commands: </p> <p><userinput>bldmake bldfiles</userinput> </p> <p><userinput>abld build vs2003 [udeb | urel] [project-name]</userinput> </p> <p>The <codeph>vs2003</codeph> platform can optionally be added to the <xref href="GUID-A12A6C54-7E9E-5ECD-A0BF-8F980160A0D2.dita">prj_platforms</xref> section in the <codeph>bld.inf</codeph> file. If this is done, <filepath>abld</filepath> commands will use the <codeph>vs2003</codeph> target without it being explictly specified. </p> </section> <section><title>Limitations</title> <ol id="GUID-B9E5639E-442E-568A-8AB6-E53C70FE2CBC"><li id="GUID-6896FE67-3A30-5F28-B6B1-CDDF738213A9"><p>If you add a source file into the project directly from Visual Studio, the source file is <i>not</i> included in the build process. You must add the source file to the <filepath>mmp</filepath> project file, and then repeat the <filepath>abld makefile</filepath> step to recreate the workspace. </p> </li> <li id="GUID-16C95FA9-66DE-5845-B2DC-B0F556A5E655"><p>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. </p> </li> <li id="GUID-AF48237B-41E5-595A-BEFC-C2CA9E8503AC"><p>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. </p> </li> <li id="GUID-9C6CE751-C237-5869-A0C4-E8BA02C9DC02"><p>In .NET2003, a problem sometimes seen is that the Build
                Solution command doesn't build the projects included in that solution, while the Build &lt;project name&gt; command builds correctly. This occurs when the Visual Studio program <filepath>uuidgen.exe</filepath> is not available in the path. Executing <filepath>vsvars32.bat</filepath> usually sets up the appropriate path. </p> </li> </ol> </section> </conbody></concept>