Before trying to make the pjsip work on my embedded device, I build the related libraries on PC as the reference. My environment is based Ubuntu 10.04. See the following guide.
http://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf
The notes of packages building:
- ALSA and OpenSSL libraries are optional and I do not install for first.
- SDL: download version 2.0 and do
./configure,make; make installto install. Addsudoif encountering privilege problems. - FFMPEG: reference the official FFMPEG documentation at https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide. Follow the guide to build yasm, x264 and ffmpeg. The ffmpeg version (0.10.6) and building process follow the pjsip guide.
- PJSIP: follow the guide to add
#define PJMEDIA_HAS_VIDEO 1inconfig_site.hand run./configure. The weird thing is that the package can still be built whether or not the definition exists. Then runmake dep,make, and optionallymake install.
It’s not hard to build the packages but there are some uncertainties. Now let’s quickly build an application with GNU tools.
The guide is at http://trac.pjsip.org/repos/wiki/Getting_Started_Using.
There is an error when running make:
cc -o myapp myapp.cpp `pkg-config --cflags --libs libpjproject`
/tmp/cczRrbTp.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [myapp] Error 1
There are two ways to solve this: either rename myapp.cpp to myapp.c, or add -lstdc++ in the Makefile:
# Makefile
all: myapp
myapp: myapp.cpp
$(CC) -o $@ $< `pkg-config --cflags --libs libpjproject` -lstdc++
clean:
rm -f myapp.o myapp
The myapp.cpp code:
/* pjsip application */
#include <pjlib.h>
#include <pjlib-util.h>
#include <pjmedia.h>
#include <pjmedia-codec.h>
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjsip_ua.h>
#include <pjsua-lib/pjsua.h>
int main()
{
printf("hello pjsip\n");
return 0;
}
Okay, that’s all and we could start our application.

Comments & Feedback