exosip2 build

Build eXosip on Win

1. download exosip   

   http://savannah.nongnu.org/projects/exosip/

2. download libcares and osip

 decompress the files to self defined folder eXosip and rename the libexosip2-5.1.0 to eXosip(exosipeXosip) ---the name defined in eXosip.sln project  

   windows: open the plateform vs project file: exosipeXosipplatformvsneteXosip.sln
   you'll find libcares/osip2/osipparser2 projects missed.

  libcares
   https://c-ares.haxx.se/
  decompress to exosip and rename it to c-ares(exosip/c-ares) --- the name defined in eXosip.sln project

  osip:
   http://savannah.gnu.org/projects/osip/   (include: osipparser2)
  decompress to exosip and rename it to osip(exosip/osip) --- the name defined in eXosip.sln project


3. openssl add

    open exosipeXosipplatformvsneteXosip.sln, and build it with vs2015

    rebuild exosip, will show not found openssl include headers error, need add openssl include files.

Use eXosip in your project

1.   add lib files  to your project.

  use the eXosip in you project , you will find there are many link error,
  many of  errors can easy to fix,  find the link error function, and added the depency lib will ok.

dependency libs.

//

Crypt32.lib
Ws2_32.lib
Dnsapi.lib
libeay32MD.lib
ssleay32MD.lib
eXosip.lib
libcares.lib
osip2.lib
osipparser2.lib
//

2. fix libcares errors

  but some of the error maybe confuse you, such as the libcares.lib link error.

1>LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>libcares.lib(ares_init.obj) : error LNK2019: 无法解析的外部符号 ares__getplatform,该符号在函数 get_DNS_Registry 中被引用
1>libcares.lib(ares_init.obj) : error LNK2019: 无法解析的外部符号 ares_strsplit,该符号在函数 set_search 中被引用
1>libcares.lib(ares_init.obj) : error LNK2019: 无法解析的外部符号 ares_strsplit_free,该符号在函数 ares_init_options 中被引用
1>libcares.lib(ares_query.obj) : error LNK2019: 无法解析的外部符号 ares_create_query,该符号在函数 ares_query 中被引用
1>C:UsersE852640DownloadsexosipeXosipDemox64DebugeXosipDemoClient.exe : fatal error LNK1120: 4 个无法解析的外部命令

cause of those errors seemed libcares lost some of the functions.
maybe the eXosip project was added libcares project too long before, and didn't contain all of the latest source files.

fix: readd all the c-ares source code files and then rebuild it. or you can find which functions and files lost, and then add it.

原文地址:https://www.cnblogs.com/leehm/p/11977943.html