如何在Visual Studio中将DLL构建为DLL? [英] How to build pjsip as DLL in Visual studio?

查看:129
本文介绍了如何在Visual Studio中将DLL构建为DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此处的说明进行操作 http://www.pjsip.org/pjlib/docs/html/group__pj__dll__target.htm

I follow the instructions here http://www.pjsip.org/pjlib/docs/html/group__pj__dll__target.htm

但是我在网上进行了一些研究后发现了以下答案,这是错误的.但这也会产生更多错误.

But I got errors, after some research in net I found below answer. But this also produces more errors.

Internet上的答案: http://评论.gmane.org/gmane.comp.voip.pjsip/16764

I managed to build pjsua.dll some time ago and wrote down a simple 
how-to. Maybe you will be lucky with that. It is in doxygen:

 <at> subsubsection subsubsec-pjsip-1x Building PJSIP version 1.x
-# Download sources from http://www.pjsip.org/.
-# Open solution in Visual Studio.
    If you use VS2010 (and maybe newer), do not open the  <at> c .sln file, but
     <at> c .dsw file for older Visual C++ since it does not contain mobile targets
    preventing from import.
-# Create empty file  <at> c pjlib/include/pj/config_site.h
    or copy it from  <at> c config_site_sample.h and add following code:
 <at> code
#define PJ_DLL  1
#ifdef _LIB
#   define PJ_EXPORTING 1
#endif
 <at> endcode
    This will build PJProject using shared libraries.
-# Choose configuration according to your needs: statically or dynamically
    linked release or debug LIBC. Recommended: <b>Release-Dynamic</b>. Do 
not forget
    to set Win32 platform.
-# At project  <at> c pjsua_lib, set Configuration type to DLL and check 
dependencies
    to the same values as in  <at> c libpjproject.
    Add  <at> c ws2_32.lib into linker input libraries. Put  <at> c 
_pjmedia_tonegen_create2
    into Linker > Input > Force Symbol References and
     <at> c pjsua_lib.dll into Linker > General > Output file.
    (Otherwise some symbols would not be exported... ask me why.)
-# Build  <at> c pjsua_lib.
-# Copy  <at> c .lib and  <at> c .dll from  <at> c pjsip/bin to  <at> c 
your/location/sip/pjsua_lib.lib
    and  <at> c pjsua_lib.dll. Note that  <at> c .dll may have  <at> c .exe extension by 
mistake.
-# Copy (merge) all contents of  <at> c include directories of projects
     <at> c pjlib,  <at> c pjlib-util,  <at> c pjmedia,  <at> c pjnath,  <at> c pjsip into
     <at> c your/location/sip/include.

Process to build branch 2.x should be similar I guess, but there is no 
.dsw any more. I can provide you with a PHP script that removes mobile 
targets from .sln and .vcproj files which are then readable by Visual 
Studio, even 2010.

Good luck!
- Vali

我遵循了所有步骤.但是我遇到了600多个错误.我正在使用最新的pjsip版本2.x.

I followed all the steps. But I got 600+ errors. I'm using latest pjsip version 2.x.

如何在Visual Studio中将DLL构建为DLL?

How to build pjsip as DLL in Visual studio?

提前致谢!!!

推荐答案

在VS2015中:右键单击项目->构建依赖项->添加依赖项. 另外在VS 2013中:右键单击项目->属性->通用属性->引用->添加新引用 需要引用的项目列表可以复制,例如来自libproject PJSIP项目.

In VS2015: Right Click on project -> Build Dependencies -> Add Dependencies. Additionally in VS 2013: Right Click on the project -> Properties -> Common Properties -> References -> Add new Reference The list of projects need to be referenced can be copied e.g. from libproject PJSIP project.

这篇关于如何在Visual Studio中将DLL构建为DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆