1、首先先在官方網站下載PWLib DLL libraries、OpenH323 DLL libraries、PWLib原始碼、OpenH323原始碼。
2、http://www.voxgratia.org/bin/flexbison.zip下載flexbison.zip用於GNU bison(GNU bison工具是編譯PWLib所必須的.而GNU flex 並不是所有的人需要)解壓這2個先行編譯工具在"C:/"下(或者你選擇的目錄),這樣就會建立"C:/Tools"這個目錄,並在這個目錄下有"FLEX.EXE"和"BISON.EXE"兩個檔案,並在"C:/TOOLS/SHARE"目錄下有"BISON.SIMPLE"和"BISON.HAIRY".
3、檢查VC標頭檔
在VC6.0中對STL支援的標頭檔有許多缺陷。這些缺陷對那些依賴於全域靜態變數的正確行為的程式是足以致命的。幸運的是,STL的作者為MSVC新發布的檔案正確的解決了大多數的問題。如果你的機器中沒有找到這個,你可以從http://www.voxgratia.org/releases/msvc6chk.zip這裡下載。然後用命令" msvc6chk upgrad"運行msvc6chk程式。
4、配製目錄
從"Tool"菜單中選擇"Option",然後按下面的要求設定目錄:
將installDir/PWlib/LIB加入Executable directory
將installDir/openh323/lib/加入Executable directory
將installDir/tools/加入Executable directory
將insallDir/PWLIB/INCLUDE/PWLIB/MSWIN加入Include directory
將insallDir/PWLIB/INCLUDE/PTLIB/MSOS加入Include directory (注意添加順序)
將insallDir/PWLib/include加入Include directory
將insallDir/openh323/include加入Include directory
將installDir/PWlib/LIB加入Library directory
將installDir/openh323/lib/加入Library directory
在系統的Path環境變數中添加installDir/tools; installDir/PWlib/LIB; installDir/openh323/LIB;
5、首先編譯PWLIB工程。
在include目錄下面將ptbuildopts.h.in Copy後粘貼,然後改名ptbuildopts.h;
批量編譯以下三個工程:ASNParser - Win32 Release", "pwtest - Win32 Release"和"pwtest - Win32 Debug"
編譯時間候會出現很多Error的,很好解決:定位到出錯地方,加上幾個' 單引號就可以了
6、編譯完成後再編譯openh323工程
要下到最新版本的原始碼,然後把裡面的openh323/configure.exe替換掉就可以了!
把openh323buildopts.h這個檔案從你的工程中刪掉。
然後一次編譯"OpenH323Lib files", "OpenH323dll files"等。
成功即可,剩下可以下載h323用戶端,進行編譯,
常見錯誤:
1、
編譯時間報錯如下:
g:/lxpdata/ip_phone/src/openh323/pwlib_1.5.2/pwlib/include/ptlib/object.h(585) : error C2146: syntax error : missing ';' before identifier 'CanTrace'
g:/lxpdata/ip_phone/src/openh323/pwlib_1.5.2/pwlib/include/ptlib/object.h(798) : error C2146: syntax error : missing ';' before
解決:
這是vc 環境中include 設定有順造成的,正確的請參考:
./PWLib/Include/PwLib/MSWIN
./PWLib/Include/PtLib/MSOS
./PWLib/Include
2、
編譯時間報錯:
Configuring Build Options
Invalid keyboard code specified
This program cannot be run in DOS mode.
Error executing c:/winnt/system32/cmd.exe.
simple.exe - 1 error(s), 0 warning(s)
解決:
<1>、下載flexbison,在官方網站www.openh323.org 上是可以下到的;解壓到C盤根目錄下面;
<2>、設定好系統的Path環境變數(在設定/控制台/系統 /進階/環境變數/系統變數/path),添加以下路徑;
c:/tools
C:/PWLib/Lib
C:/OpenH323/Lib
<3>、在include目錄下面將ptbuildopts.h.in Copy後粘貼,然後改名ptbuildopts.h;
<4>、批量編譯以下三個工程:ASNParser - Win32 Release", "pwtest - Win32 Release"和"pwtest - Win32 Debug"