您的位置:首页 > 运维架构

如何成功的在MSVC6下编译PWLIB1_12_0 /OPENH323 2_4_0

2009-06-04 14:12 369 查看
1. 首先从http://www.openh323.org/code.html下载pwlib.zip 和 openh323.zip;

或者是http://sourceforge.net/project/showfiles.php?group_id=80674
2. 把pwlib.zip 、openh323.zip分别展开到目录e:/h323/source/pwlib及e:/h323/source/openh323下;
3. 启动MSVC6,Tools | Options | Directories,按如下顺序到INCLUDE FILES 路径里:
e:/h323/source/PWLib/Include/PwLib/MSWIN
e:/h323/source/PWLib/Include/PtLib/MSOS
e:/h323/source/PWLib/Include
e:/h323/source/OpenH323/Include
【注意:顺序一定不能错】
再把下面三行加入到Library files 和 Executable files 路径里
c:/Tools
e:/h323/source/PWLib/Lib
e:/h323/source/OpenH323/Lib
把上述三行也加入到系统的 PATH 环境变量里(在设置 | 控制面板 | 系统 | 高级 | 环境变量 | 系统变量 | path)。

4. 如果要编译你需要bison 和 flex ,你可以从这里下载http://www.openh323.org/bin/flexbison.zip或者http://www.voxgratia.org/bin/flexbison.zip,并把它解压缩到C盘(一定是C盘),确认flex.exe和bison.exe在c:/Tools目录下,确认bison.hairy和bison.simple在C:/tools/Share目录下;
5. 在http://www.ebao.biz/down/Configure.rar, 下载后解压缩至e:/h323/source/PWLib/Tools目录下; 高版本已经集成了Configure.dsp
6. 在pwlib 的第一级目录打开 pwlib.dsw , 如果提示问你config.dsp,选择目录e:/h323/source/PWLib/Tools下的Configure目录下的config.dsp;
7. 首先编译Build列表中的Configure项目;
8. 拷贝E:/h323/resource/pwlib/tools/Configure/Release目录下的configure.exe至e:/h323/source/PWLib及e:/h323/source/openh323目录下;最新版本已经有configure.exe,无需拷贝

9. 编译
提示错误:
1>D:/Microsoft Visual Studio 8/VC/PlatformSDK/include/winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
1>D:/Microsoft Visual Studio 8/VC/PlatformSDK/include/winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support

default-int
1>D:/Microsoft Visual Studio 8/VC/PlatformSDK/include/winnt.h(5940) : error C2146: syntax error : missing ';' before identifier 'Buffer'
1>D:/Microsoft Visual Studio 8/VC/PlatformSDK/include/winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support

default-int
1>D:/Microsoft Visual Studio 8/VC/PlatformSDK/include/winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support

default-int

第一类问题的解决:错误发生在:operator=(LONG);函数定义中,这是因为在VC6中,如果没有显示的指定返回值类型,编译器将其视为默认整 形;但是vs2005不支持默认整

形,解决这个问题不能修改每个没有显示指示返回值类型的函数地方,可以用wd4430来解决;具体的在工程选项中的c+ +/Command Line中添加/wd4430即可。

2,在Tools->Options->Projects and solutions->vc++ directories->show directories for里选择include files
然后增加
D:/DX90SDK/Include
D:/DX90SDK/Samples/C++/DirectShow/BaseClasses
D:/DX90SDK/Samples/C++/Common
可能会问题依旧,调整一下include files的顺序吧,把他们都放在最后,例如我的环境:
$(VCInstallDir)include
$(VCInstallDir)atlmfc/include
$(VCInstallDir)PlatformSDK/include
$(FrameworkSDKDir)include
D:/DX90SDK/Include
D:/DX90SDK/Samples/C++/DirectShow/BaseClasses
D:/DX90SDK/Samples/C++/Common
然 后在project->BaseClasses properties->configuration->C/C++ -> General->Additional Include Directories里面的内容(.,../../../../include)删掉,重新编译

,PVOID64的错误消失,原因如下:
POINTER_64 是一个宏,在64位编译下起作用,它包含在SDK目录下的BASETSD.H中(Microsoft Visual Studio 8/VC/PlatformSDK/Include/basetsd.h(23):#define

POINTER_64 __ptr64),但DXSDK自己也带了一个basetsd.h,里面没有定义POINTER_64,从而导致出错,只需要改变include files的优先级即可。当然,也可以改写winnt.h

中的代码,在下面这两行:typedef void *PVOID;
typedef void *POINTER_64 PVOID64;
之前增加一行:
#define POINTER_64 __ptr64

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zblue78/archive/2009/02/14/3889313.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: