Changes between Initial Version and Version 1 of Getting_Started_Using

Mar 12, 2007 9:13:13 PM (15 years ago)



  • Getting_Started_Using

    v1 v1  
     1= Building Application using PJSIP with GNU Tools = 
     3This article is a continuation of the '''Getting Started''' article as described in 
     5== Requirements == 
     7 * This article is only valid with '''version''' release or later of the libraries. 
     8 * GNU tools (GNU make, binutils, gcc, and the likes). 
     10== Steps for Building Your Application that Uses PJSIP/PJMEDIA == 
     12 1. First, build {{{pjproject}}} libraries as described in This normally is accomplished by executing these commands: 
     13    {{{$ ./configure && make dep && make}}} 
     14 1. Create a directory outside the PJSIP sources for your project and place your source files there. 
     15 1. Create a file named '''Makefile''' in your source directory with the following content: 
     17#Modify this to point to the PJSIP location. 
     20include $(PJBASE)/build.mak 
     22CC      = $(APP_CC) 
     24LDLIBS  = $(APP_LDLIBS) 
     25CFLAGS  = $(APP_CFLAGS) 
     28# If your application is in a file named myapp.cpp or myapp.c 
     29# this is the line you will need to build the binary. 
     30all: myapp 
     32myapp: myapp.cpp 
     33        $(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) $< 
     36        rm -f myapp.o myapp 
     38 1. There few things to note when making the '''Makefile''' above: 
     39    1. First, make sure that you replace '''PJBASE''' with the location of PJSIP sources in your computer, and 
     40    1. If you notice there are spaces towards the bottom of the file (before {{{$(CC)}}} and {{{rm}}}, these are a single tab, not spaces. '''This is important''', or otherwise '''make''' command will fail with "'''missing separator'''" error. 
     41    1. Change {{{myapp.cpp}}} to your source filename. 
     42 1. Create {{{myapp.cpp}}} in the same directory as your {{{Makefile}}}. At minimum, it may look like this: 
     44#include <pjlib.h> 
     45#include <pjlib-util.h> 
     46#include <pjmedia.h> 
     47#include <pjmedia-codec.h> 
     48#include <pjsip.h> 
     49#include <pjsip_simple.h> 
     50#include <pjsip_ua.h> 
     51#include <pjsua-lib/pjsua.h> 
     53int main() 
     55        return 0; 
     58 1. Last, run '''make''' in your source directory.