Changes between Version 15 and Version 16 of Getting-Started/Windows


Ignore:
Timestamp:
Apr 29, 2009 9:36:40 PM (16 years ago)
Author:
ismangil
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Windows

    v15 v16  
    7373== Next: Using pjproject libraries for your own application == 
    7474 
    75 Regardless of the build system being used, the following tasks are normally needed to be done in order to build application to use PJSIP and PJMEDIA: 
    76  
    77    1. Put these include directories in the include search path: 
     75   1. Put these include directories in the include search path of your project: 
    7876          * pjlib/include 
    7977          * pjlib-util/include 
     
    9593}}} 
    9694      (Note: the documentation of the relevant libraries should say which header files should be included to get the declaration of the APIs). 
    97    4. Declare the OS macros. 
    98           * For Windows applications built with Visual Studio, we need to declare PJ_WIN32=1 macro in the project settings (declaring the macro in the source file may not be sufficient). 
     95   4. Declare PJ_WIN32=1 macro in the project settings (declaring the macro in the source file may not be sufficient). 
    9996          * For Windows Mobile applications build with Visual C++, we need to declare PJ_WIN32_WINCE=1 macro in the project settings. 
    100           * For GNU build system/autoconf based build system, we need to declare PJ_AUTOCONF=1 macro when compiling the applications. 
     97  
     98    5. 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. 
    10199 
    102       (Note: the old PJ build system requires declaring the target processor with PJ_M_XXX=1 macro, but this has been made obsolete. The target processor will be detected from compiler's predefined macro by pjlib/config.h file). 
    103    5. Link with the appropriate PJ libraries. The following libraries will need to be included in the library link specifications: 
    104100 
    105       pjlib 
    106           Base library used by all libraries.  
    107       pjlib-util 
    108           Auxiliary library containing scanner, XML, STUN, MD5, getopt, etc, used by the SIP and media stack.  
    109       pjnath 
    110           NAT helper library (STUN, TURN, ICE).  
    111       pjsip 
    112           SIP core stack library.  
    113       pjsip-ua 
    114           SIP user agent library containing INVITE session, call transfer, client registration, etc.  
    115       pjsip-simple 
    116           SIP SIMPLE library for base event framework, presence, instant messaging, etc.  
    117       pjsua 
    118           High level SIP UA library, combining SIP and media stack into high-level easy to use API.  
    119       pjmedia 
    120           The media framework.  
    121       pjmedia-codec 
    122           Container library for various codecs such as GSM, Speex, and iLBC.  
    123  
    124         
    125  
    126       Note: the actual library names will be appended with the target name and the build configuration. For example: 
    127  
    128       For Visual Studio builds 
    129  
    130           The actual library names will look like pjlib-i386-win32-vc6-debug.lib, pjlib-i386-win32-vc6-release.lib, etc., depending on whether we are building the Debug or Release version of the library. 
    131  
    132           An easier way to link with the libraries is to include PJ project files in the workspace, and to configure project dependencies so that the application depends on the PJ libraries. This way, we don't need to manually add each PJ libraries to the input library file specification, since VS will automatically link the dependency libraries with the application. 
    133       For Windows Mobile builds 
    134  
    135           Unfortunately the PJ libraries built for Windows Mobile will not be placed in the usual lib directory, but rather under the output directory under build/wince-evc4 project directory. 
    136  
    137           An easier way to link with the libraries is to include PJ project files in the workspace, and to configure project dependencies so that the application depends on the PJ libraries. This way, we don't need to manually add each PJ libraries to the input library file specification, since VS will automatically link the dependency libraries with the application. 
    138       For GNU builds 
    139  
    140           Use the template Makefile below (as described in Building Application using PJSIP with GNU Tools): 
    141           # Modify this to point to the PJSIP location. 
    142           PJBASE=/home/myself/pjproject-0.5.10.2 
    143  
    144           include $(PJBASE)/build.mak 
    145  
    146           CC      = $(APP_CC) 
    147           LDFLAGS = $(APP_LDFLAGS) 
    148           LDLIBS  = $(APP_LDLIBS) 
    149           CFLAGS  = $(APP_CFLAGS) 
    150           CPPFLAGS= ${CFLAGS} 
    151  
    152           # If your application is in a file named myapp.cpp or myapp.c 
    153           # this is the line you will need to build the binary. 
    154           all: myapp 
    155  
    156           myapp: myapp.cpp 
    157                    $(CC) -o $@ $< $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) 
    158  
    159           clean: 
    160                   rm -f myapp.o myapp 
    161  
    162         
    163    6. 
    164  
    165       Link with system spesific libraries: 
    166  
    167       Windows 
    168  
    169           Add (among other things): wsock32.lib, ws2_32.lib, ole32.lib, dsound.lib 
    170       Linux, *nix, *BSD 
    171  
    172           Add (among other things): '-lpthread -lm' (at least). If you use the template Makefile above, these would have been added by PJ. 
    173       MacOS X 
    174  
    175           Add (among other things): '-framework CoreAudio -lpthread -lm'. If you use the template Makefile above, these would have been added by PJ. 
    176  
     101   6. Link with system specific libraries such as: wsock32.lib, ws2_32.lib, ole32.lib, dsound.lib 
     102    
    177103