Building with pjsua_lib as DLL

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

 



Hi Tomas,

I'm developing a SIP phone on windows mobile for my company. After searching
a lot, I found the only project which done the same thing using pjsip is
Sipek project. Also the project made a dll file wrapping pjsip and used it.
The problem is that, the working in the project has been stopped for over a
year now and the dll file was made about 2 years ago, so I can't use it
effectively or modify in it. For these reasons I decided to make my own dll
file. Searching for how to do so showed me ur e-mail so I tried to do the
steps u mentioned. I made the steps 1, 2 and 3 but unfortunately a list of
errors appeared and building failed. I'll list the errors below, but do u
have any suggestions on how to approach what I want?

thanks in advance

Error 18 error LNK2019: unresolved external symbol __imp__ntohs at 4 referenced
in function _pj_ntohs pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 19 error LNK2001: unresolved external symbol __imp__ntohs at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 20 error LNK2019: unresolved external symbol __imp__htons at 4 referenced
in function _pj_htons pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 21 error LNK2001: unresolved external symbol __imp__htons at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 22 error LNK2019: unresolved external symbol __imp__ntohl at 4 referenced
in function _pj_ntohl pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 23 error LNK2001: unresolved external symbol __imp__ntohl at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 24 error LNK2001: unresolved external symbol __imp__ntohl at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 25 error LNK2001: unresolved external symbol __imp__ntohl at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 26 error LNK2019: unresolved external symbol __imp__htonl at 4 referenced
in function _pj_htonl pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 27 error LNK2001: unresolved external symbol __imp__htonl at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 28 error LNK2001: unresolved external symbol __imp__htonl at 4
libsrtp-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 29 error LNK2019: unresolved external symbol
__imp__inet_ntoa at 4referenced in function _pj_inet_ntoa
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 30 error LNK2019: unresolved external symbol
__imp__inet_addr at 4referenced in function _pj_inet_aton
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 31 error LNK2019: unresolved external symbol
__imp__WSAStringToAddressA at 20 referenced in function _pj_inet_pton
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 32 error LNK2019: unresolved external symbol
__imp__WSAAddressToStringA at 20 referenced in function _pj_inet_ntop
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 33 error LNK2019: unresolved external symbol
__imp__gethostname at 8referenced in function _pj_gethostname
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 34 error LNK2019: unresolved external symbol
__imp__WSAGetLastError at 0referenced in function _pj_sock_socket
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 35 error LNK2001: unresolved external symbol __imp__WSAGetLastError at 0
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 36 error LNK2001: unresolved external symbol __imp__WSAGetLastError at 0
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 37 error LNK2019: unresolved external symbol
__imp__WSASocketA at 24referenced in function _pj_sock_socket
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 38 error LNK2019: unresolved external symbol __imp__bind at 12 referenced
in function _pj_sock_bind pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 39 error LNK2019: unresolved external symbol
__imp__closesocket at 4referenced in function _pj_sock_close
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 40 error LNK2019: unresolved external symbol
__imp__getpeername at 12referenced in function _pj_sock_getpeername
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 41 error LNK2019: unresolved external symbol
__imp__getsockname at 12referenced in function _pj_sock_getsockname
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 42 error LNK2019: unresolved external symbol __imp__send at 16 referenced
in function _pj_sock_send pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 43 error LNK2019: unresolved external symbol
__imp__sendto at 24referenced in function _pj_sock_sendto
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 44 error LNK2019: unresolved external symbol __imp__recv at 16 referenced
in function _pj_sock_recv pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 45 error LNK2019: unresolved external symbol
__imp__recvfrom at 24referenced in function _pj_sock_recvfrom
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 46 error LNK2019: unresolved external symbol
__imp__getsockopt at 20referenced in function _pj_sock_getsockopt
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 47 error LNK2019: unresolved external symbol
__imp__setsockopt at 20referenced in function _pj_sock_setsockopt
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 48 error LNK2019: unresolved external symbol
__imp__connect at 12referenced in function _pj_sock_connect
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 49 error LNK2019: unresolved external symbol
__imp__shutdown at 8referenced in function _pj_sock_shutdown
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 50 error LNK2019: unresolved external symbol
__imp__listen at 8referenced in function _pj_sock_listen
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 51 error LNK2019: unresolved external symbol
__imp__accept at 12referenced in function _pj_sock_accept
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 52 error LNK2019: unresolved external symbol
__imp__WSAStartup at 8referenced in function _pj_init
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 53 error LNK2019: unresolved external symbol
__imp__WSACleanup at 0referenced in function _pj_shutdown
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 54 error LNK2019: unresolved external symbol
__imp__WSASetLastError at 4referenced in function _pj_set_netos_error
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 55 error LNK2019: unresolved external symbol
__imp__gethostbyname at 4referenced in function _pj_gethostbyname
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 56 error LNK2019: unresolved external symbol
__imp__ioctlsocket at 12referenced in function _pj_ioqueue_register_sock
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 57 error LNK2019: unresolved external symbol
___WSAFDIsSet at 8referenced in function _PJ_FD_ISSET
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 58 error LNK2019: unresolved external symbol
__imp__select at 20referenced in function _pj_sock_select
pjlib-i386-win32-vc8-release-dynamic.lib pjsua_lib
Error 59 fatal error LNK1120: 32 unresolved externals
..\bin\pjsua_lib-i386-Win32-vc8-Release-Dynamic.exe pjsua_lib


On Tue, Dec 14, 2010 at 9:41 PM, Tom?? Valenta <vali at kamarad.cz> wrote:

> 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?
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



-- 
Eng. Hesham Abboud
+20123185749
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110110/d4775196/attachment-0001.html>


[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