PJSIP Project

PJSIP Overview

  • Overview
    • Libraries Architecture
  • Features (Datasheet)
    • Supported Platforms
    • SIP Capabilities
      • Base specs
      • Transports
      • Routing/NAT
      • Call
      • SDP
      • Presence and IM
      • Other extensions
      • Compliance, best current practices
    • NAT Traversal
    • Media/Audio Features
      • Core
      • Audio Features
      • Video Features
      • Transports
      • Media components (Ports)
      • Clock provider
      • Codec Framework
      • SDP
      • RTP and RTCP
      • Compile Time Settings
      • Basic Types and Functions
      • Endpoint
      • Formats
      • Media Flow
      • Events
    • Video Features
    • Security Features
      • TLS/SSL
      • SIP Security
      • Media Security
    • Supported Codecs
      • Audio Codecs
      • Video Codecs
    • Supported Audio Devices
    • Supported Video Devices
  • License
    • Overview
    • The SOFTWARE
      • License
      • Alternative license
      • Special Exception
      • Third Party Software Licensing Requirements
    • Third Party SOFTWARE
      • Contributed and Public Domain Third Party Software
      • Third Party Software with Licensing Requirements
      • External Third Party Software
    • Licensing FAQ
      • Why is PJSIP licensed as GPL and not (LGPL|Apache|BSD|choose your OSS license here)?
      • What about the “viral” nature of the GPL?
      • Can I develop closed source products with PJSIP?

Get Started

  • Getting PJSIP
  • General guidelines
    • Development guidelines
      • Preparation
      • Development
      • Coding Style
      • Deployment
      • config_site.h
    • Coding Style
      • Space indentation
      • Limit line length
      • Use ANSI C/C90 Standard
      • Use C style comment
      • No declaration after statement
      • Use Doxygen comments for API
      • Use K&R style brace placement
      • Multiline function arguments
      • Multiline comment indentation
      • Please observe existing code
    • Platform Considerations
      • Android
      • iOS for iPhone, iPad, and other Apple devices
      • Windows Desktop
      • MacOS X
      • Linux Desktop
      • Windows Phone 10 (UWP)
      • Embedded Linux
      • QNX or Other Posix Embedded OS
      • Other Unix Desktop OSes
      • Porting to Other Embedded OS
      • Symbian
      • BlackBerry 10
      • Windows Mobile
    • Which API to use
      • PJSIP, PJMEDIA, and PJNATH Level
      • PJSUA-LIB API
      • PJSUA2 C++ API
      • PJSUA2 API for Java, Python, C#, and Others
    • Other specific considerations
  • Android
    • Android SIP Client Development Overview
      • Objective
      • Task outline
      • What’s next
    • PJSIP for Android features
      • SIP features
      • Security features
      • NAT traversal features
      • Audio features
      • Android Video Features
      • Sample applications
      • What’s next
    • Install the required tools and library
      • Install Android Android Studio and Android NDK
      • Install SWIG
      • Download and extract Oboe
      • Install OpenSSL
      • Download PJSIP
      • What’s next
    • Configure and build PJSIP for Android
      • Create config_site.h
      • Configuring PJSIP
      • Verifying configuration
      • Building PJSIP
      • Building PJSUA2 Java interface with SWIG
      • Copy third party native libraries
      • What’s next
    • Android Java SIP VoIP and Video Client Example
      • Open the apps in Android Studio
      • Build the project
      • Run or debug Pjsua2 app
      • Set account and register to server
      • Add buddy
      • Dialing/making a call
      • Receiving incoming call
      • Video calls
      • Notes on NAT
      • Notes on video quality
      • What’s next
    • Kotlin SIP Voice and Video Client Example
      • Open the app in Android Studio
      • Configuring SIP account and servers
      • Build the project
      • Run or debug the Kotlin app
      • Start the library
      • Making and receiving calls
      • What’s next
    • Command line/telnet SIP client example
      • Build the native code
      • Copy the third party native libraries
      • Open in Android Studio
      • Build the project
      • Run or debug the app
      • Using the CLI app
      • What’s next
    • Creating your own application
      • Creating your own application
      • Adding Video Capture Device to Your Application
      • Using Video API
      • Video capture orientation support
      • Installing additional components
    • Common issues when developing Android SIP client
      • Pjsua2 keeps stopping during startup
      • Failed to load native library pjsua2
      • Failed to load native library libssl.so
      • Failed to load native library libcrypto.so
      • Failed to load native library liboboe.so
      • Failed to load native library openh264
      • No implementation found for void org.pjsip.pjsua2.pjsua2JNI.swig_module_init()
      • Tip: find library dependencies
      • Unable to make or receive call due to large message size
      • Garbage collector may crash your app (Pjsua2 API)
      • OpenSLES audio device deadlock upon shutdown
      • Bad audio recording quality on some devices
  • iPhone/iOS
    • Build Instructions
      • Requirements
      • Build Preparation
      • Building PJSIP
      • Using PJSIP in your application
      • Video Support
      • TLS/OpenSSL Support
    • Common issues when developing iOS apps
      • Accepting calls in the background with PushKit
      • CallKit integration and audio session (AVAudioSession) management
      • Crash after calling PJLIB APIs using Grand Central Dispatch (GCD)
      • Audio lost or other issues with interruption (by a phone call or an alarm), headset plug/unplug, or Bluetooth input
      • SIP transport keepalive while in background
      • Unable to accept incoming call in background mode (iOS 8 or older)
  • Mac/Linux/Unix
    • Build Instructions with GNU Build Systems
      • Supported Targets
      • Requirements
      • ./configure
      • Cross Compilation
      • Running make
      • Build Customizations
      • Optional: Installing PJSIP
    • Using PJSIP in applications
  • Windows
    • Build Instructions
      • Build Preparation
      • Requirements
      • Building the Projects
      • Debugging Sample Applications
    • Using PJSIP in Windows applications
    • Common issues when developing on Windows
      • Troubleshooting crash problem on Win32
  • Windows Phone
    • Build Instructions
      • Requirements
      • Build Preparation
      • Building and running the Projects
      • Debugging Application
      • Other References
    • Windows Runtime (WinRT) Overview
      • Windows Runtime
      • Windows RT
      • Windows Phone Runtime
      • Windows Phone 8
      • Windows Phone 8.1
      • References
  • CMake (experimental)
    • Build Instructions with CMake
      • Supported Platforms
      • Requirements
      • Quick Start
      • Common Configurations
      • Configure Options
      • Configuring TLS Support
      • Site-Specific Configuration (config_site.h)
      • Build Targets
      • Running Tests
      • Installing
      • Cross-Compilation
      • CMake vs GNU ./configure
      • Known Limitations
    • Using PJSIP in CMake Projects
      • Minimal Example
      • Exported Targets
      • Selecting Components
      • Pointing CMake at the Install Prefix
      • Version Requirements
      • Embedding PJSIP via add_subdirectory
      • Interaction with System Dependencies

PJSUA2 Guide

  • Introduction to PJSUA2
  • Building PJSUA2
    • Common Requirements
    • Building Python SWIG Module
    • Building Java SWIG Module
    • Building C# SWIG Module
  • General Concepts
    • Classes Overview
      • pj::Endpoint
      • pj::Account
      • pj::Media
      • pj::Call
      • pj::Buddy
    • Guidelines
      • Class Usage Patterns
      • Error Handling
      • Asynchronous Operations
      • Threading
      • Problems with Garbage Collection
      • Objects Persistence
  • Hello World!
    • C++
    • Python3
    • Java
  • Using PJSUA2
    • The Endpoint
      • Instantiating the endpoint
      • Creating the library
      • Initializing and configuring the library
      • Creating one or more transports
      • Starting the library
      • Shutting down the library
    • Accounts
      • Subclassing the Account class
      • Creating userless accounts
      • Creating account
      • Account configurations
      • Account operations
    • Working with audio media
      • The conference bridge
      • Playing a WAV file
      • Recording to WAV file
      • Local audio loopback
      • Looping audio
      • Call’s media
      • Second call
      • Conference call
      • Recording the Conference
    • Working with video media
      • The video conference bridge
      • Account video configuration
      • Starting camera preview
      • Important note about threading
      • Call’s video media
      • Modifying video during a call
      • Configuring a video window
      • Video event
      • Video conference call
    • Calls
      • Subclassing the Call class
      • Making outgoing calls
      • Receiving Incoming Calls
      • Call Properties
      • Call Disconnection
      • Working with Call’s Audio Media
      • Setting media direction
      • Call Operations
      • Instant Messaging(IM)
    • Presence and Instant Messaging
      • Subclassing the Buddy class
      • Subscribing to Buddy’s Presence Status
      • Responding to Presence Subscription Request
      • Changing Account’s Presence Status
      • Instant Messaging(IM)
  • Sample Applications
    • PJSUA2 Samples

Specific Guides

  • Specific Guides
  • Audio
    • Acoustic Echo Cancellation (AEC)
    • Audio Frame Manipulation
      • PJSUA2 — AudioMediaPort
      • C / PJSUA-LIB / PJMEDIA alternatives
      • Cross-cutting tools
      • PJSUA-LIB / PJMEDIA equivalents
    • Audio Conference Bridge
      • Overview
      • Backend selection
      • Worker threads (parallel backend)
      • Measuring bridge capacity with the MIPS test
      • Asynchronous operations
      • Op-completion callback
      • Custom port lifecycle
      • Per-port TX / RX state
      • Port direction and signature
      • Common pitfalls
      • PJSUA-LIB equivalents
    • Customizing the Audio Stream Port
      • Introduction
      • The PJSUA call-teardown sequence
      • Pattern A — wrapping the precreated stream port
      • Pattern B — replacing the precreated stream port
      • Checklist
      • PJSUA2 equivalents
      • See also
    • Handling HW insertion/removal
    • Intel IPP codecs integration
    • Jitter buffer features and operations
      • Features
      • Operations
    • OpenCore AMR codecs integration
      • Building and Installing OpenCORE AMR Library
      • Adding AMR Support in PJSIP
      • Testing PJSIP For OpenCORE AMR Support
    • Switchboard
    • WebRTC integration
  • Audio Troubleshooting
    • How to record audio with pjsua
    • Audio is breaking up
    • Audio drop-outs or “stutters”
    • High jitter value observed by remote party
    • Loud static noise
    • No audio is heard in local speaker
    • No audio is heard by remote party
    • Reducing audio latency
      • Overview
      • Optimizing sound device latency
      • Codec latency
      • Use audio switchboard
      • Choosing lower audio frame length
      • Optimizing Jitter Buffer Latency
      • Other sources of latency
    • Soft/quiet noise
    • Audio troubleshooting checklists
      • Checking that codec is negotiated properly by both parties
      • Check audio interconnection in the conference bridge
      • Check CPU utilization
      • Check for dangling call in PBX
      • Checking the quality of the sound device
      • Check for audio underflows/overflows
      • Check that correct device is used
      • Check by looping back microphone to speaker
      • Check if RTP packets are received
      • Testing and optimizing audio device with pjsystest
      • Checking by playing a WAV file
      • Check for problematic clock rate
      • Check for network impairments of incoming RTP packets
      • Check that audio is transmitting and to correct remote address
  • Build & Integration
    • Adding FFMPEG support
      • Installation
      • Building PJPROJECT with FFMPEG support
    • Mingw-w64
  • Development & Programming
    • Group Lock
      • Introduction
      • Usage
      • Debugging
      • Notes
    • Using thread with PJSUA initialization and shutdown
    • PJSIP Guide
    • Coding Style
      • Space indentation
      • Limit line length
      • Use ANSI C/C90 Standard
      • Use C style comment
      • No declaration after statement
      • Use Doxygen comments for API
      • Use K&R style brace placement
      • Multiline function arguments
      • Multiline comment indentation
      • Please observe existing code
  • Media
    • Integrating Third Party Media Stack into PJSUA-LIB
    • AI Connectivity
      • Overview
      • PJSUA2 API
      • PJMEDIA API
      • Events
      • Backends
      • Limitations
      • Sample app
    • Understanding Audio Media Flow
      • Introduction
      • Audio playback flow (the main flow)
      • Audio recording flow
      • Sound device timing problem
      • Incoming RTP/RTCP Packets
    • RTCP Feedback
    • Tone generator algorithms performance
      • The Algorithms
      • Accuracy
      • Performance
      • Conclusion
    • Transport Adapter
      • Introduction to media transport
      • Media transport adapter
      • Implementing a custom transport adapter
      • Integrating custom transport adapter
  • Network & NAT
    • Handling IP address change
      • Problem description
      • API: pjsua_handle_ip_change()
      • pjsua_handle_ip_change() flow
      • Notes and limitations
      • IP change scenarios
      • IP address change detection
    • IPv6 and NAT64 support
      • Availability
      • IPv6 Modes and Defaults (PJSIP 2.14+)
      • Enabling IPv6 support in application using PJSUA-LIB
      • IPv4 ↔ IPv6 transitions during IP address change
      • NAT64
      • References
    • Manual ICE Host Candidates
      • Overview
      • How it works
      • PJSUA2 usage
      • PJSUA-LIB usage
      • When manual hosts are not enough
      • PJSUA-LIB equivalents
      • References
    • Getting around blocked, filtered, or mangled VoIP network
      • Use TCP/TLS for SIP Traffic
      • Disable STUN
      • Relay RTP via TURN/TCP
      • Use Non-standard Ports for VoIP Services
    • Getting around NAT (for media)
      • Use STUN and/or TURN and/or ICE
      • Disabling VAD
      • Using Port Forwarding
      • Still having NAT problem?
    • QoS Support
      • Introduction on QoS
      • Availability
      • Objective
      • Design
      • Limitations
      • Using QoS in PJSIP Applications
      • References
    • Using SIP TCP Transport
      • Enabling TCP support
      • Sending Initial Requests
      • Contact Header
      • Subsequent Requests
      • Automatic Switch to TCP if Request is Larger than 1300 bytes
      • Additional Info about Registration
    • Using ICE in non-SIP Applications
      • Introduction
      • Terminology
      • Fitting ICE in the application
      • Preparations
      • Basic lifecycle
      • Notes
    • Using Trickle ICE
      • Overview
      • Enabling Trickle ICE
      • How candidates are conveyed
      • Detecting peer trickle support
      • Programmatic candidate notifications
      • Debugging
      • Interaction with other ICE features
      • PJSUA-LIB equivalents
      • References
    • Troubleshooting ICE negotiation failure
      • How ICE works
      • Sample session
      • ICE negotiation failures
    • TURN over TCP and TLS
      • Overview
      • Choosing a connection type
      • PJSUA2 — TURN over UDP or TCP
      • PJSUA-LIB — TURN over UDP, TCP, or TLS
      • Allocations vs the data path
      • Defaults and ports
      • Interaction with ICE
      • PJSUA-LIB equivalents
      • References
  • Performance & Footprint
    • Footprint Optimization
      • Overview
      • Reducing executable size
      • Reducing heap memory usage
    • ICE Heap Usage
      • Scope
      • How the memory usage is calculated
      • Call Setup
      • Checkpoints
      • Running with Default Settings
      • Optimizing the Memory Usage
      • More Optimized Results
      • Wait, There’s More!
      • Final Result
      • Conclusion
      • Appendix
    • Performance Optimization
      • Maximising performance
      • How to configure pjsip to serve thousands of calls
    • Media Performance (MIPS test)
      • Test Method
      • Interpreting the Results
      • Results
  • Security
    • SIP Digest Authentication
      • Overview
      • Build prerequisites
      • Selecting the digest algorithm (client side)
      • Issuing challenges (server side)
      • Helper APIs
      • AKA authentication
      • Backward compatibility and deprecations
      • See also
    • SRTP - Secure RTP (SDES and DTLS)
      • Introduction
      • Features
      • Requirements
      • How to integrate
      • Building PJSIP with SRTP Support
      • Using SRTP
      • AES-GCM support
    • SSL/TLS
      • Overview
      • Build-time decisions
      • Configuring TLS in your application
      • Operating TLS at runtime
      • Operational examples
      • Troubleshooting
      • See also
  • SIP
    • PJSIP Guide
    • Asynchronous SIP Authentication
      • Overview
      • PJSUA2 API
      • PJSUA-LIB API
      • PJSIP API
      • Design Notes
    • Busy Lamp Field (BLF) and Dialog Event
      • Overview
      • Enabling the package
      • PJSUA-LIB API
      • PJSUA2 API
      • Low-level PJSIP-Simple API
      • Dialog-info XML
      • Known limitations
      • References
    • Customizing SIP Messages
      • Account-level customization
      • Customizing outgoing calls (From / Contact / Call-ID)
      • Other SipTxOption / pjsua_msg_data fields
      • Modifying locally generated SDP
      • Patching messages with a PJSIP module
      • PJSUA-LIB equivalents
    • Implement DNS SRV failover
    • DTMF
      • Overview
      • Sending DTMF
      • Tuning RFC 4733 transmission
      • DTMF flash (event 16)
      • Receiving DTMF
      • SDP / capability negotiation
      • Sending inband DTMF tones
      • Implementing an inband DTMF detector
      • PJSUA-LIB equivalents
    • Real-Time Text (RFC 4103)
      • Overview
      • RTT vs SIP MESSAGE / instant messaging
      • Build prerequisites
      • Negotiating a text stream
      • Sending text
      • Receiving text
      • Redundancy level (RFC 4103 / RFC 2198)
      • Sample applications
      • PJSUA-LIB equivalents
    • Processing redirection (3xx) response
      • Features
      • Redirection with PJSIP API
      • Redirection with PJSUA-LIB API
      • Redirection with PJSUA2 API
      • Redirection in pjsua application
    • Reducing SIP message size
    • TCP/TLS Transport
    • URI Escaping
  • Video
    • Sample Applications with Video
    • Modifying Video Codec Parameters
      • Size or resolution
      • Framerate
      • Bitrate
    • Video Conference
      • How the bridge works
      • Bridge configuration and limits
      • Mixing layout
      • Default wiring
      • Looking up VideoMedia handles
      • Connecting and disconnecting flows
      • Three-party video conference
      • Adding a custom port
      • Asynchronous operations and completion callback
      • PJSUA-LIB equivalents
    • Audio/Video Synchronization
      • Default behaviour in PJSUA-LIB
      • AVI playback
      • How the synchronization works
      • Direct PJMEDIA API (custom pipelines)
      • PJSUA-LIB equivalents
    • Setting Video Capture Orientation
      • Strategy A — rotate at the capture device (default)
      • Strategy B — signal the peer (no device-side rotation)
    • Video Keyframe Transmission
      • Outgoing keyframe request
      • Incoming keyframe request
      • Keyframes at the start of a stream
      • Associated media events
      • PJSUA-LIB equivalents
    • Video Best Practices
      • Threading and GUI frameworks
      • Video window UX
    • Video Components and Backends
      • Capture devices
      • Renderer devices
      • Video codecs
      • Format converter
      • Media events
      • Where to look next
  • Video Troubleshooting
    • Choppy / frozen / blocky video
    • Green frames
    • “Invalid video device” / no preview
    • Network / IP change leaves video black
    • Lipsync drift
    • Low video quality despite good network
    • Mobile: video stops after backgrounding
    • No video at peer (persistent black)
    • Reducing video latency
    • Video troubleshooting checklists
      • Video-specific checks
      • Shared with audio troubleshooting
  • Other
    • PJSUA Command Line Interface (CLI) Manual
      • Introduction
      • Commands
    • iOS Push Notifications
      • Why VoIP push is required
      • Architecture overview
      • App lifecycle
      • Application-side: PushKit and CallKit integration
      • PJSIP-side configuration
      • Server-side checklist
      • Common pitfalls
      • Sample reference
      • PJSUA2 equivalents
    • Writing guide
      • Heading convention
      • Typography conventions
      • Cross referencing
      • Linking from external website
      • Notes, Warnings, and Blocks
      • Local TOC
      • Converting from Trac wiki

API Reference & Samples

  • PJSUA2
    • API Reference
      • User Agent
      • Account
      • Call
      • Media
      • Presence
      • Supporting APIs
    • PJSUA2 Samples
  • PJSUA-LIB
    • API Reference
    • PJSUA-LIB Samples
  • PJSIP
    • PJSIP Guide
    • API Reference
      • Compile Time Settings
      • Core
      • Message Elements
      • Transport
      • Authentication
      • Transaction Layer
      • Base UA/Common Dialog Layer
      • User Agent Layer
      • Event and Presence
    • PJSIP Samples
  • PJMEDIA
    • PJMEDIA Core
      • Core
      • Audio Features
      • Video Features
      • Transports
      • Media components (Ports)
      • Clock provider
      • Codec Framework
      • SDP
      • RTP and RTCP
      • Compile Time Settings
      • Basic Types and Functions
      • Endpoint
      • Formats
      • Media Flow
      • Events
    • PJMEDIA-Codec
      • Audio Codecs
      • Video Codecs
      • Detail information:
      • Android H.264, VP8, VP9 (native)
      • BCG729 (a G.729 compliant codec)
      • FFMPEG codecs (H.261, H.263, H.263P (H263-1998), H.264, MJPEG, VP8, VP9)
      • G.711
      • G.722
      • G.722.1/C
      • GSM FR
      • ILBC
      • Lyra (experimental)
      • OpenCore AMR NB/WB
      • OpenH264
      • Opus
      • Passthrough codecs
      • SILK
      • Speex
      • VP8 and VP9 (libvpx)
    • PJMEDIA-AudioDev
      • Overview
      • Using the Audio Device API
      • API Reference
      • Supported devices:
      • ALSA
      • Android OpenSL (deprecated)
      • Android JNI
      • Android Oboe
      • bdIMAD by BdSound
      • CoreAudio (Mac OS X and iPhone)
      • WMME (Windows and Windows Mobile devices)
      • WASAPI (Windows Audio Session API)
      • No longer supported devices:
      • PortAudio
      • Blackberry BB10
      • Nokia APS/VAS
      • Symbian MMF
    • PJMEDIA-VideoDev
      • API Reference
      • Supported devices
      • Android Camera2
      • AVI virtual device
      • AVFoundation (Mac and iOS) and UIView (iOS)
      • Colorbar
      • DirectShow (Windows)
      • FFMPEG
      • Metal (Mac and iOS)
      • OpenGL (desktops)/OpenGL ES 2 (Android, iOS)
      • QuickTime
      • SDL
      • Video4Linux
    • PJMEDIA Samples
  • PJNATH
    • Introduction to NAT and NAT Traversal
      • The NAT traversal problems
      • The NAT traversal solutions
      • ICE Solution - The Protocol that Works Harder
      • PJNATH - The building blocks for effective NAT traversal solution
    • API Reference
      • Basic Types and Functions
      • ICE and Trickle ICE
      • STUN
      • TURN
      • uPnP
      • NAT Type Detection
    • PJNATH Samples
  • PJLIB-UTIL
    • Basic Types and Functions
    • Command-Line Interface (CLI) Framework
    • Encoding and Encryptions
    • Text and Strings
    • DNS
    • HTTP
    • STUN
    • File Formats
  • PJLIB
    • Key Features
      • Extreme Portability
      • Small Footprint
      • Big in Performance
      • No Dynamic Memory Allocations
      • Rich Features
    • API Reference
      • Basic Types and Functions
      • Infrastructure
      • Data structure
      • Network
      • SSL/Secure Socket
      • File
      • Memory Management
      • String & Unicode
      • Multithreading and Concurrency
      • OS Abstraction
      • Time and Timer
      • Random and GUID
      • Application Microframework
      • Unit Testing
  • All Samples
    • PJSUA2 Samples
    • PJSUA-LIB Samples
    • PJSIP Samples
    • PJMEDIA Samples
    • PJNATH Samples
PJSIP Project
  • Building Dynamic Link Libraries (DLL/DSO)
  • View page source

Building Dynamic Link Libraries (DLL/DSO)

group pj_dll_target

The libraries support generation of dynamic link libraries for Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian terms). Similar procedures may be applied for Win32 DLL with some modification.

Depending on the platforms, these steps may be necessary in order to produce the dynamic libraries:

  • Create the (Visual Studio) projects to produce DLL output. PJLIB does not provide ready to use project files to produce DLL, so you need to create these projects yourself. For Symbian, the MMP files have been setup to produce DSO files for targets that require them.

  • In the (Visual Studio) projects, some macros need to be declared so that appropriate modifiers are added to symbol declarations and definitions. Please see the macro section below for information regarding these macros. For Symbian, these have been taken care by the MMP files.

  • Some build systems require .DEF file to be specified when creating the DLL. For Symbian, .DEF files are included in pjlib distribution, in pjlib/build.symbian directory. These DEF files are created by running ./makedef.sh all from this directory, inside Mingw.

Macros related for building DLL/DSO files:

  • For platforms that supports dynamic link libraries generation, it must declare PJ_EXPORT_SPECIFIER macro which value contains the prefix to be added to symbol definition, to export this symbol in the DLL/DSO. For example, on Win32/Visual Studio, the value of this macro is __declspec(dllexport), and for ARM ABIv2/Symbian, the value is EXPORT_C.

  • For platforms that supports linking with dynamic link libraries, it must declare PJ_IMPORT_SPECIFIER macro which value contains the prefix to be added to symbol declaration, to import this symbol from a DLL/DSO. For example, on Win32/Visual Studio, the value of this macro is __declspec(dllimport), and for ARM ABIv2/Symbian, the value is IMPORT_C.

  • Both PJ_EXPORT_SPECIFIER and PJ_IMPORT_SPECIFIER macros above can be declared in your config_site.h if they are not declared by pjlib.

  • When PJLIB is built as DLL/DSO, both PJ_DLL and PJ_EXPORTING macros must be declared, so that PJ_EXPORT_SPECIFIER modifier will be added into function definition.

  • When application wants to link dynamically with PJLIB, then it must declare PJ_DLL macro when using/including PJLIB header, so that PJ_IMPORT_SPECIFIER modifier is properly added into symbol declarations.

When PJ_DLL macro is not declared, static linking is assumed.

For example, here are some settings to produce DLLs with Visual Studio on Windows/Win32:

  • Create Visual Studio projects to produce DLL. Add the appropriate project dependencies to avoid link errors.

  • In the projects, declare PJ_DLL and PJ_EXPORTING macros.

  • Declare these macros in your config_site.h:

           #define PJ_EXPORT_SPECIFIER  __declspec(dllexport)
           #define PJ_IMPORT_SPECIFIER  __declspec(dllimport)
    

  • And in the application (that links with the DLL) project, add PJ_DLL in the macro declarations.


© Copyright 2025, Teluu.

Built with Sphinx using a theme provided by Read the Docs.