| 1 | = Getting Started: Building for Microsoft Windows = |
| 2 | |
| 3 | This page describes how to use Microsoft Visual Studio to build pjsip libraries. |
| 4 | |
| 5 | Note: You can also build for Windows using GNU tools such mingw. Follow the steps in [wiki:Getting-Started-Autoconf Getting Started: Building with GNU Tools/Autoconf]. |
| 6 | |
| 7 | == Build Preparation == |
| 8 | |
| 9 | It is important that you create a config_site.h as described in [wiki:Building-Preparation Building Preparation] |
| 10 | |
| 11 | == Requirements == |
| 12 | |
| 13 | The Visual Studio based project files can be used with one of the following tools: |
| 14 | |
| 15 | * Microsoft Visual Studio 6, |
| 16 | * Microsoft Visual Studio .NET 2002, |
| 17 | * Microsoft Visual Studio .NET 2003, |
| 18 | * Microsoft Visual C++ 2005 (including Express edition), |
| 19 | |
| 20 | In addition, the following SDK's are needed: |
| 21 | |
| 22 | * Platform SDK (tested with Platform SDK for Windows Server 2003 SP1). |
| 23 | * DirectX SDK (tested with DirectX version 8 and 9), |
| 24 | * OpenSSL development kit (optional) is needed if TLS support is wanted. Learn more: [wiki:Installing-OpenSSL-Windows Installing OpenSSL Libraries on Windows]. |
| 25 | |
| 26 | Note: The new Platform SDK is still needed for Visual Studio 6, although VS6 comes with its own Platform SDK. The new Platform SDK is needed for Iphlpapi.[h|lib] for the new PJNATH library. |
| 27 | |
| 28 | For the host, the following are required: |
| 29 | |
| 30 | * Windows NT, 2000, XP, 2003, or later , |
| 31 | * Windows 95/98 should work too, but this has not been tested, |
| 32 | * Sufficient amount of RAM for the build process. |
| 33 | |
| 34 | |
| 35 | == Building the Projects == |
| 36 | |
| 37 | Follow the steps below to build the libraries/application using Visual Studio: |
| 38 | |
| 39 | 1. For Visual Studio 6: open pjproject.dsw workspace file. |
| 40 | 2. For Visual Studio 8 (VS 2005): open pjproject-vs8.sln solution file. |
| 41 | 3. Set pjsua as Active Project. |
| 42 | 4. Select Debug or Release build as appropriate. |
| 43 | 5. Build the project. This will build pjsua application and all libraries needed by pjsua. |
| 44 | 6. After successful build, the pjsua application will be placed in pjsip-apps/bin directory, and the libraries in lib directory under each projects. |
| 45 | |
| 46 | To build the samples: |
| 47 | |
| 48 | 1. (Still using the same workspace) |
| 49 | 2. Set samples project as Active Project |
| 50 | 3. Select Debug or Release build as appropriate. |
| 51 | 4. Build the project. This will build all sample applications and all libraries needed. |
| 52 | 5. After successful build, the sample applications will be placed in pjsip-apps/bin/samples directory, and the libraries in lib directory under each projects. |
| 53 | |
| 54 | |
| 55 | == Debugging Sample Applications == |
| 56 | |
| 57 | Sample applications are built using Samples.mak makefile, therefore it is difficult to setup debugging session in Visual Studio for these applications. To solve this issue, the pjsip_apps workspace contain one project called sample_debug which can be used to debug a sample application. |
| 58 | |
| 59 | To setup debugging using sample_debug project: |
| 60 | |
| 61 | 1. Set sample_debug project as Active Project |
| 62 | 2. Edit debug.c file inside this project. |
| 63 | 3. Modify the #include line to include the particular sample application to debug |
| 64 | 4. Select Debug build. |
| 65 | 5. Build and debug the project. |
| 66 | |