Version 20 (modified by ismangil, 14 years ago) (diff) |
---|
Getting Started: Building for Microsoft Windows
TracNav
Getting Started- Moved to: https://docs.pjsip.org/en/latest/index.html#get-started
Preparation
Build for Desktop
Build for Mobile
- iOS: Apple iPhone, iPad, and iPod Touch
- Android
- BlackBerry 10 (BB10)
- Windows Mobile
- Windows Phone 8.x and UWP
Symbian...
- Build for Other
Next: Using the libraries
See Also
This page describes how to use Microsoft Visual Studio to build pjsip libraries:
- Build Preparation for Windows
- Requirements
- Building the Projects
- Debugging Sample Applications
- Next: Using pjproject libraries for your own application
Note: You can also build for Windows using GNU tools such mingw. Follow the steps in Getting Started: Building with GNU Tools/Autoconf.
Build Preparation for Windows
- It is important that you create a config_site.h as described in Build Preparation
- Get the source code, if you haven't already.
Requirements
The Visual Studio based project files can be used with one of the following tools:
- Microsoft Visual Studio 6,
- Microsoft Visual Studio .NET 2002,
- Microsoft Visual Studio .NET 2003,
- Microsoft Visual C++ 2005 (including Express edition),
- Microsoft Visual Studio 2008. Follow the instructions for Visual Studio 2005.
In addition, the following SDK's are needed:
- Essential: DirectX SDK (tested with DirectX version 8 and 9). After installing DirectX, add the paths to the include files and the library to Visual Studio.
- Optional if not using Visual Studio 2008: Platform SDK (tested with Platform SDK for Windows Server 2003 SP1).
- Optional: OpenSSL development kit is needed if TLS support is wanted. Learn more: Installing OpenSSL Libraries on Windows.
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.
For the host, the following are required:
- Windows NT, 2000, XP, 2003, or later ,
- Windows 95/98 should work too, but this has not been tested,
- Sufficient amount of RAM for the build process.
Building the Projects
Follow the steps below to build the libraries/application using Visual Studio:
- For Visual Studio 6/2002/2003: open pjproject.dsw workspace file.
- For Visual Studio 8 (VS 2005): open pjproject-vs8.sln solution file.
- Set pjsua as Active Project.
- Set Win32 as the platform.
- Select Debug or Release build as appropriate.
- Build the project. This will build pjsua application and all libraries needed by pjsua.
- After successful build, the pjsua application will be placed in pjsip-apps/bin directory, and the libraries in lib directory under each projects.
To build the samples:
- (Still using the same workspace)
- Set samples project as Active Project
- Select Debug or Release build as appropriate. See Visual Studio Build Configuration page for explanation of each provided build configuration
- Build the project. This will build all sample applications and all libraries needed.
- After successful build, the sample applications will be placed in pjsip-apps/bin/samples directory, and the libraries in lib directory under each projects.
Debugging Sample Applications
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.
To setup debugging using sample_debug project:
- Set sample_debug project as Active Project
- Edit debug.c file inside this project.
- Modify the #include line to include the particular sample application to debug
- Select Debug build.
- Build and debug the project.
Next: Using pjproject libraries for your own application
- Put these include directories in the include search path of your project:
- pjlib/include
- pjlib-util/include
- pjnath/include
- pjmedia/include
- pjsip/include
- Put the combined library directory lib (located in the root directory of pjproject source code) in the library search path
- Include the relevant PJ header files in the application source file. For example, using these would include ALL APIs exported by PJ:
#include <pjlib.h> #include <pjlib-util.h> #include <pjnath.h> #include <pjsip.h> #include <pjsip_ua.h> #include <pjsip_simple.h> #include <pjsua-lib/pjsua.h> #include <pjmedia.h> #include <pjmedia-codec.h>
(Note: the documentation of the relevant libraries should say which header files should be included to get the declaration of the APIs). - Declare PJ_WIN32=1 macro in the project settings (declaring the macro in the source file may not be sufficient).
- For Windows Mobile applications build with Visual C++, we need to declare PJ_WIN32_WINCE=1 macro in the project settings.
- Link with the main pjproject library libpjproject. It includes all the libraries provided. Note: the actual library names will be appended with the target name and the build configuration. For example: The actual library names will look like libpjproject-i386-win32-vc6-debug.lib depending on whether we are building the Debug or Release version of the library.
- Link with system specific libraries such as: wsock32.lib, ws2_32.lib, ole32.lib, dsound.lib
Attachments (2)
-
VS2008IncDir.png
(34.2 KB) -
added by ismangil 12 years ago.
Setting Include files for VS 2008
-
VS2008LibDir.png
(36.7 KB) -
added by ismangil 12 years ago.
Setting library paths for VS 2008
Download all attachments as: .zip