Visual Studio 6.0编译PWLib总结

1. 我的环境

Visual Studio 6.0Visual Studio.NET 2010Microsoft Platform SDK for Windows Server 2003 R2Microsoft SDKsMicrosoft DirectX 9.0 SDKMinGW

2. 注意

尝试编译前,请务必阅读 http://www.cnblogs.com/yedaoq/archive/2011/02/22/1960866.html 。本文只涉及部分我在我的编译环境中遇到的,并且官方编译说明中没有包含的问题。

3. 项目变动、编译顺序

在官方文档中,提到的编译顺序为:Console、Console Components、PWLib。但在目前最新版本(1.12)的PWLib中,已经不再包含Console Components项目。官方解释是为了简化Windows下库文件的管理,并与Unix保持一致。Console Components的所有源文件都添加到Console工程中了。

据我观察,installdir\PWLib\src\ptclib中的文件应该就是原Console Components工程的内容,而installdir\PWLib\src\ptlib则是原Console工程的内容。理由是:根据官方文档,Console Components是一个包含额外的PWLib特性的工程,这些特性依赖于特定的其它库和SDK。由于我的机器上存在Platform SDK、DirectX SDK,这些SDK包含了对Direct Sound、IPv6等的支持,在Console的编译过程中,需要手动将installdir\PWLib\src\ptclib中的部分文件添加到Console工程中。这部分文件的功能在我看来符合“特性”的定义。因而我推测原Console Components的文件被放置在installdir\PWLib\src\ptclib目录中。当然,这只是猜测而已。

新版本的PWLib的编译顺序为Console、MergeSym、PWLib,MergeSym是一个新工程。官方FAQ中有关于此工程的一些陈述:PWLib和OpenH323试图在各个版本间保持DLL入口点的序号的一致性,MergeSym程序会比较DLL中的函数签名与.dtf文件中列出的入口点,并确保最终的文件以兼容的序号结束。

3. Include、Lib目录顺序

PWLib包含对_CrtReportBlockType的调用,其所在头文件为crtdbg.h。但是VC6带的crtdbg.h不包含该函数,而Platform SDK带的crtdbg.h中包含。因而platform SDK目录应在VC6目录之前。

另外,PWLib自带了Wince和WM平台的一些头文件。在之前的编译过程中,这些头文件有影响。因此,建议将PWLib目录置于Include目录的偏后位置。另外,我觉得也可尝试移除这些头文件,它们在installdir\PWLib\include\ptlib\wince和installdir\PWLib\include\ptlib\wm中。

4. Console编译问题

错误内容:

Microsoft Platform SDK for Windows Server 2003 R2 \sdk\include\wspiapi.h(47) : error C2265: '' : reference to a zero-sized array is illegal

解决办法:

wspiapi.h头文件头部添加语句:#define _WSPIAPI_COUNTOF

错误内容:

fatal error C1083: Cannot open source file: '.\podbc.cxx': No such file or directory

解决办法:

该文件位置不对,实际位置在installdir\PWLib\src\ptclib中。

错误内容:

G:\Open Source\ptlib\src\ptlib\common\videoio.cxx(567) : error C2059: syntax error : '}' G:\Open Source\ptlib\src\ptlib\common\videoio.cxx(568) : error C2143: syntax error : missing ';' before '}'

解决办法:

sizeTable表的最后一个子结构中没有定义内容(即使用成员默认值)。但在VC上无法编译通过,其写法应改为:{ NULL, 0, 0 }。

5. MergeSym编译问题

MergeSym编译过程中,一般会出现链接问题。有两个解决方向:

首先,删除.dtf文件。之前说过,MergeSym会用.dtf文件来保持DLL入口序号的兼容性。默认的dtf文件包含启用了所有特性时的入口点列表,即最全的列表。如果实际上没有启用某些特性,则MergeSym的对比过程会失败。官方建议删除所有的.dtf文件。这些文件在installdir\PWLib\include\ptlib\msos中。

其次,当启用了某些特性时,需要手动向Console工程中添加额外的文件,否则会在编译MergeSym时出链接错误。Console编译过程中,configure程序会扫描所有硬盘驱动器,查找其中的程序库,基于此确定启用哪些特性。以下为安装了platform SDK和VC6时的特性加载情况:

Located DNS Resolver at f:\program files\microsoft platform sdk for windows server 2003 r2\Located IPv6 Support at f:\program files\microsoft platform sdk for windows server 2003 r2\include\Located QoS Support at f:\program files\microsoft platform sdk for windows server 2003 r2\include\Located ODBC support at f:\program files\microsoft platform sdk for windows server 2003 r2\include\Located Direct Sound Support at f:\program files\microsoft visual studio\vc98\Features:Version enabledByte Order enabledSemaphore Support enabledPlugin Support enabledDNS Resolver enabledCyrus SASL DISABLEDOpen LDAP DISABLED due to absence of feature saslOpen SSL DISABLEDOpen SSL AES DISABLED due to absence of feature opensslWindows Open SSL DISABLEDWindows Open SSL AES DISABLED due to absence of feature winsslExpat XML DISABLEDWindows Expat XML DISABLEDVXML DISABLED due to absence of feature expat|winexpatJabber DISABLED due to absence of feature expat|winexpatXMLRPC DISABLED due to absence of feature expat|winexpatSOAP DISABLED due to absence of feature expat|winexpatSpeech API DISABLEDIPv6 Support enabledQoS Support enabledSimple DirectMedia Layer DISABLEDVideo Support enabledASN Support enabledSTUN Support enabledpipe channel Support enabledDTMF encoding/decoding support enabledWAV file support enabledSOCKS protocol support enabledFTP protocol support enabledSNMP protocol support enabledTelnet protocol support enabledremote connection support enabledSerial Support enabledPOP3/SMTP Support enabledHTTP Support enabledHTTP service Support enabledConfig file protocol support enabledSocket aggregation support enabledVideo file support enabledSound support enabledDirect Sound Support enabledODBC support enabled

若启用了这些特性,则需要向Console工程添加至少下列文件:installdir\PWLib\src\ptclib目录中的delaychan.cxx、http.cxx、pvfiledev.cxx、pvidfile.cxx、pwavfile.cxx、pwavfiledev.cxx,以及installdir\PWLib\src\ptlib\common中的pglobalstatic.cxx。

若要阻止Configure扫描某些位置以免启用某些特性,可以编辑环境变量:MSVC_PWLIB_CONFIGURE_EXCLUDE_DIRS或PWLIB_CONFIGURE_EXCLUDE_DIRS等。

6. PWLib编译问题

错误内容:

Microsoft Visual Studio\VC98\INCLUDE\d3dtypes.h(14) : fatal error C1083: Cannot open include file: 'subwtype.h': No such file or directory

解决办法:

添加WIN32宏的定义,可添加到dllmain.cxx中。如:#define WIN32 1

错误内容:

LINK : fatal error LNK1181: cannot open input file "ptclib.lib"

解决办法:

之前提到Console Components项目合并到Console中了,因而PWLib项目也不再需要依赖ptclib.lib(Console Components的输出)。打开PWLib项目属性框->Link页->Object/Library Modules,将其中的ptclib.lib去掉即可。

错误内容:

fatal error LNK1202: "ptlib.pdb" is missing debugging information for referencing module

解决办法:

将installdir\PWLib\Lib文件夹删除,所有工程重新编译。

转载于:https://www.cnblogs.com/yedaoq/archive/2011/02/22/1961336.html

Visual Studio 6.0编译PWLib1.12总结相关推荐

  1. Visual Studio 2017在编译OpenCV 4.2.0时出现编译器错误C2001:常量中有换行符

    Visual Studio 2017在编译OpenCV 4.2.0时出现编译器错误C2001:常量中有换行符 问题描述: Visual Studio 2017在编译OpenCV 4.2.0时出现编译器 ...

  2. MS Visual Studio 2008 编译错误 microsoft visual studio 9.0\vc\include\new.h(60) : error C2065: '_In_opt_

    这几天为了使用一个带有256*256 PNG格式的icon图标,必须在visual studio 2008上编译.因此,在一台xp机器上装了2008,之前这台电脑还安装了sdk,WDK和vs2005. ...

  3. 《Microsoft Visual Studio 6.0 Enterprise Edition》

    说明:在这里可以下载到如下关于VS6.0所需要的一些内容,如下: ------------------------------------------------------------------- ...

  4. Visual Studio 6.0 下载地址 V6.0各种版本官方下载网址

    Visual Stdio 6包含下列组件: [下列全套组件包含在VSE600ENU1.iso,VSE600ENU2.iso,VSE600ENU3.iso,VJP60_ENU1.iso] Microso ...

  5. 解决OpenSSL加入到在Visual Studio 2019中编译返回LNK2019错误

    文章目录 小结 问题和解决 Error LNK2019 Error LNK1104 Warning C4996 参考 小结 碰到了OpenSSL加入到在Visual Studio 2019中编译返回L ...

  6. BUG: Setup Was Unable to Create a DCOM User Account Error Message in Visual Studio 6.0

    今天在安装VS 6.0时,遇见这个问题:Setup was unable to create a DCOM user account in order to register <path> ...

  7. 1c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h(24) : fatal error C1189: #err

    1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h(24) : fatal error C1189: # ...

  8. ubuntu下使用visual studio code来编译和调试C++

    最近想在linux上编译c++代码,自己却一直习惯window上的IDE.以前公司要我写Linux代码的时候,我一般都是用eclipse + CDT,而eclipse这东西吧,我个人感觉因为加载组件太 ...

  9. Visual Studio 2017在编译时出现错误E2512:功能测试宏的参数必须是简单标识符

    Visual Studio 2017在编译时出现错误E2512:功能测试宏的参数必须是简单标识符 问题描述: Visual Studio 2017在编译时出现错误E2512:功能测试宏的参数必须是简单 ...

最新文章

  1. Mqtt ----心跳机制
  2. 在xcode4中使用cocos2d 2.x很顺利的
  3. 钜惠来袭丨神策学堂推出 SACA 四季班,留给你的时间不多了
  4. nginx linux源码编译安装,Linux源码编译安装nginx
  5. LiveVideoStack线上交流分享 (十四) —— 深度学习在视频分析处理的实践
  6. python3.5安装教程linux_安装Python 3.6在Ubuntu 16.04上
  7. python颜色校正
  8. 介绍一个可以轻松下载病毒样本的数据库
  9. android 7 蓝牙版本,Android N及高版本蓝牙适配
  10. @property python知乎_知乎某处XSS+刷粉超详细漏洞技术分析
  11. 2022苏州市人力资源服务业四项评比结果公布,盖雅榜上有名
  12. 火爆外网的ChatGPT,改Bug,敲代码不在话下
  13. 年轻人为何总是在跳槽?
  14. TRIZ普及热潮有望到来
  15. 资产负债表 利润表 现金流量表
  16. 0003-动态环境绿色公益环保宣传PPT模板免费下载
  17. 杭电1042c语言循环,HDU杭电1052 Tian Ji - The Horse Racing答题报告
  18. k8s通过命令批量删除pod
  19. 游戏网站的设计与实现(HTML和CSS实现魔兽世界官网)
  20. 手机计算机怎么改背景,qq聊天背景隔离区怎么制作?QQ隔离区背景制作教程(电脑版手机版)...

热门文章

  1. 聊聊恺明大神MAE的成功之处!
  2. NLP模型BERT和经典数据集!
  3. 一行代码都不写!Github 博客小白版入门教程
  4. 985高校挖出古墓!网友:毕业论文自己找上门来了
  5. 重磅!2022QS世界大学排名公布!
  6. 05后都上清华了!首批丘成桐数学领军人才名单发布,三位菲尔兹奖得主为其授课,周末就来学校报到...
  7. 有了四步解题法模板,再也不害怕动态规划!
  8. Linux之软件安装 apt-get
  9. 为啥同一个程序,单步执行和debug执行出现的结果不一样呢?
  10. 整理对应_JSP第二版课后习题答案【侵权联系我删除】