Building with pjsua_lib as DLL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

recently I tried to compile pjsua_lib 1.8.10 as a single DLL for using 
in our application. We are migrating from 1.0.3. Everything went fairly 
OK with some obstacles, though. Here I would like to write down the 
steps I made and fixes if there were problems.

1. Opened in Visual Studio 2008, chosen Release-Dynamic configuration on 
Win32 platform.
2. Put following in config_site.h:
#define PJ_DLL 1
#ifdef _LIB
#	define PJ_EXPORTING 1
#endif
3. Set dependencies of pjsua_lib to the same as libpjproject and set its 
configuration type to DLL. Also added _pjmedia_tonegen_create2 to Force 
reference symbols in linker options, because this symbol would not be 
available otherwise.
4. Built pjsua_lib project. This was enough for our application needs, 
but to make PJSUA using this DLL following steps must be taken:

5. Set PJSUA's dependencies to pjsua_lib only. Now when tried to build 
PJSUA, following Unresolved externals appeared:
_pjmedia_add_rtpmap_for_static_pt
_pjsip_include_allow_hdr_in_dlg
_pjsip_use_compact_form
_pj_optarg
_pj_getopt_long
_pj_optind
(And also some _pjmedia_tonegen_... if not set in step 3.)

6. Following lines must be patched:
pjmedia/src/pjmedia/enpoint.c:52 Use PJ_DEF_DATA
pjsip/src/pjsip/sip_dialog.c:44  Use PJ_DEF_DATA
pjsip/src/pjsip/sip_msg.c:147    Use PJ_DEF_DATA
pjsip-apps/src/pjsua/pjsua_app.c:962--964 Use PJ_DECL_DATA
pjsip-apps/src/pjsua/pjsua_app.c:1676     Use PJ_DECL_DATA
Also add PJ_DECL and PJ_DEF macros to pjlib-util/src/pjlib-util/getopt.*
And put to the PJSUA's Force reference symbols also _pj_getopt_long.

7. Now PJSUA compiles and works correctly.

I hope this post will be useful for someone and the suggested patches 
will be applied to the trunk, because I think this is the way it should 
be done, but correct me if I am wrong.

Cheers,
- Vali

PS. Have you any idea, why "Force reference symbols" must be set sometimes?



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux