在Window下编译OpenH323
? ? ? ? 本文只提供VC6.0的編譯說明,如果想知道VC.Net下的編譯過程請參看原文。
原文 :
? ? ? ? ?http://www.voxgratia.org/docs/pwlib_windows.html#msvc_headers
作者 :Craig Southeren
翻譯 ?: Richard
原文更新日期:2004年11月16日
正文:
1.簡介
? 在OpenH323.org上所寫的 在windows下編譯PWLib的過程是非常簡單的。而這篇文章提供了非常詳細的用VC6.0編譯PWLib的過程。(原文還提供了VS.net2003下的編譯過程,因為沒有用過VC.net,所以這里不提供說明)
2.先決條件
? 如果你準備編譯PWLib源代碼你必須先有以下幾個條件:
? a.VC6.0
? b.PWLib源代碼。
? c.一個解壓程序,比如說Winzip
3.下載和安裝PWLib源代碼
? 你從[url=http://sourceforge.net/project/showfiles.php?group_id=80674]這里[/url]或者從CVS上下載,然后解壓到install/PWLIB
4.編譯前的準備
? 在編譯PWlib之前有許編譯工作,一但你完全這些工作之后,再編譯它進就不再需要了。
?4a.安裝GNU bison
? ? ?GNU bison工具是編譯PWLib所必須的.而GNU flex 并不是所有的人需要,除非你想重新編譯"asnparser"工具(asnparser是用來改變OpenH323提供的ASN文件的).
? ? ?[url=http://www.voxgratia.org/bin/flexbison.zip]這里[/url]提供這兩個工具的預編譯版本。下面是工具的安裝步驟:
? ? ?解壓這2個預編譯工具在"C:/"下(或者你選擇的目錄),這樣就會創建"C:/Tools"這個目錄,并在這個目錄下有"FLEX.EXE"和"BISON.EXE"兩個文件,并在"C:/TOOLS/SHARE"目錄下有"BISON.SIMPLE"和"BISON.HAIRY".
重要提示:
? ? ? ?你可以安裝bison到除C:/Tools以外的別的目錄中,但是如果目錄名中存在空格的話就會出現問題。除非你確信你能正確的做到所有的事情,否剛不要設置像"C:/Documents and Settings" 這樣的目錄名。
? ? 。在VC6.0里面,從Tool菜單中選擇Options,然后把C:/Tools中到可執行的目錄下面。
? ? ?
? ? 4b.檢查VC頭文件
? ?在VC6.0中對STL支持的頭文件有許多缺陷。這些缺陷對那些依賴于全局靜態變量的正確行為的程序是足以致命的。幸運的是,STL的作者為MSVC新發布的文件正確的解決了大多數的問題。
? ? PWLib所在的程序會檢查機器中所安裝的VC6.0的頭文件,并升級他所需的。為了運行這個程序,你必須先找到installdir/MSVC_UPGRADE.BAT 并運行它。如果你的機器中沒有找到這個,你可以從[url=http://www.voxgratia.org/releases/msvc6chk.zip]這里[/url]下載。然后用命令" msvc6chk upgrad"運行msvc6chk程序。
? ?然后,你將看到類似下面的屏幕:
? ?PWLIB File Upgrader v1.0
? ? ?Copyright (C) 2004 by Post Increment
? ? ?WARNING: the following file requires upgrading:
? ? ?C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE
? ? ?The files presented here are copyright ? 1995-2000 by P.J. Plauger.
? ? ?All rights reserved. They are for use only in conjunction with a valid
? ? ?license for Microsoft Visual C++ V5.0 or V6.0. Microsoft Corporation is in
? ? ?no way involved with the production or release of these files. The files are
? ? ?offered on an `as is' basis. DINKUMWARE, LTD. AND P.J. PLAUGER MAKE NO
? ? ?REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THESE FILES, EITHER
? ? ?EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
? ? ?MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
? ? ?DINKUMWARE, LTD. AND P.J. PLAUGER SHALL NOT BE LIABLE FOR ANY DAMAGES
? ? ?SUFFERED BY LICENSEE AS A RESULT OF USING THESE FILES.
? ? ?Upgrade file (y/n) ?
? ? 按"Y"升級MSVC的頭文件,接著下面的屏幕會出現:
? Upgrade file (y/n) ? y
? ? The following files have been upgraded
? ? C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE
? ? The previous version of the file has been renamed to
? ? ?C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE.backup
在升級的過程中,你將被問到,很多次是否升級,我們的建義是如果你沒有什么很好的理由,請全部升級它們。
如果文件已經升級,你將會看到:
? ? PWLIB File Upgrader v1.0
? ?Copyright (C) 2004 by Post Increment
? ?C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE already upgraded
? ? Press any key to continue . . .
如果想知道更多的關于升級的信息,請看http://www.dinkumware.com/vc_fixes.html。
5.配制目錄
從"Tool"菜單中選擇"Option",然后按下面的要求設置目錄:
。將insallDir/PWLib/include加入Include directory
。將installDir/PWlib/LIB加入Executable directory
。將installDir/PWlib/Lib加入Library directory
6.安裝可選的文件。
? ?PWlib的創建過程中會自動尋找系統所安裝的文件。在你開始建立PWLib工程前,你可以選擇你以下的文件包進行安裝。
? ?OpenSSL, OpenLDAP, expat, SDL, IPV6,MicroSoft Speech API, DNS resolver
7.編譯
? 不管你怎么設置的環境,有3個不同的工程你需要建立(不管是debug版或Release版)
? ?工程名 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?描述 ? ? ? ? ? ? ? ? ? ? ?Debug版 ? ? ? ? ? ? ? Release版
? console ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PWlib的基本靜態庫 ? ? ? ? ? ?ptlibsd.lib ? ? ? ? ? ? ? ? ? ?ptlibs.lib
? ?console Components ? ? ? ? ? ? ? 包含PWlib庫 ? ? ? ? ? ? ? ? ?ptclibd.lib ? ? ? ? ? ? ? ? ? ? ptclib.lib
? ?PTLib ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?包含PWlib庫 ? ? ? ? ? ? ? ? ?ptlidb.lib&ptlibd.dll ? ? ? ptlib.lib&ptlib.dll
? ? 靜態庫可以獨立編譯,但是要建立DLL需要先建立“MERGESYM"工具。
編譯步驟:
1. 打開 installdir/PWLIB/PWLIB.DSW
2. 在Workspace中選擇"File View"
3. 在Build toolbar中選擇編譯類型"Win32 Release" 或者"Win32 Debug"。
4. 右鍵點擊"Console files" ,然后從菜單中選擇"Build"建立ptlibs.lib。
?
5.接著會出現以下的顯示(由于欠的環境配制會有所不同)
? ? ? ?--------------------Configuration: Console - Win32 Release--------------------
Configuring Build Options
PWLIB File Upgrader v1.0
Copyright (C) 2004 by Post Increment
C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE already upgraded
Located Open LDAP at D:/openldap/
Located Expat XML at D:/expat/
Located Speech API at D:/Program Files/Microsoft Speech SDK 5.1/
Searching C:/
Located DNS Resolver at C:/Program Files/Microsoft Visual Studio/VC98/
Searching D:/
Located Cyrus SASL at D:/cyrus-sasl-2.1.12/
Located Open SSL at D:/openssl-0.9.7/
Searching E:/
Byte Order set to PLITTLE_ENDIAN
Semaphore Support enabled
DNS Resolver enabled
Cyrus SASL enabled
Open LDAP enabled
Open SSL enabled
Expat XML enabled
Speech API enabled
IPv6 Support disabled
QoS Support disabled
Simple DirectMedia Layer disabled
Configuration completed.
Performing Custom Build Step on ../common/getdate.y
../common/getdate.y contains 8 shift/reduce conflicts and 18 reduce/reduce conflicts.
Compiling...
assert.cxx
Compiling...
collect.cxx
contain.cxx
ethsock.cxx
? ? ...lines deleted....
regexec.c
regfree.c
Generating Code...
Creating library...
ptlibd.lib - 0 error(s), 1 warning(s)
重要提示:
?1. 如果你安裝了Miscrosof Platform SDK, 你也許會看到:
? Compiling...
assert.cxx
C:/Program Files/Microsoft SDK/include/winsock2.h(1218) : error C2061: syntax error : identifier 'DWORD_PTR'
C:/Program Files/Microsoft SDK/include/winsock2.h(1262) : error C2146: syntax error : missing ';' before identifier 'Key'
C:/Program Files/Microsoft SDK/include/winsock2.h(1262) : error C2501: 'ULONG_PTR' : missing storage-class or type specifiers
....
如果發生這種情況,你應該從"Tools"目錄中選擇"Option",然后在include directory中將Platform SDK加到
VC98 inlcude之前:
? ? ? ?
2。如果出現在下面情況:
? ? --------------------Configuration: Console - Win32 Release--------------------
Configuring Build Options
PWLIB File Upgrader v1.0
Copyright (C) 2004 by Post Increment
WARNING: the following file requires upgrading:
C:/Program Files/Microsoft Visual Studio/VC98/INCLUDE/XTREE
Please run "msvc6chk upgrade" to upgrade this file
Error executing c:/winnt/system32/cmd.exe.
ptlibs.lib - 1 error(s), 1 warning(s)
請重新閱讀第4步
然后像上面那樣,編譯"Console componnets files"。
再編譯"PTLib files "
如果都編譯成功后,你就可以編譯"PWlib files"了。
8。編譯ASNParser
? ?如果你用的是PWlib1.7/Openh323 1.4以后的程序,或者是Janus patch 4, 你就可以跳過這一步
?(本文提供的下載地址是不用這一步的)
?如果是以前的版本你需要編譯ASNParser,如果你沒有編譯它將會出現以下的錯誤:
? This program cannot be run in DOS mode.
Error executing c:/windows/system32/cmd.exe.
asnparser.exe - 1 error(s), 0 warning(s)
后記:
? ?到此,在VC6.0中編譯PWlib就完了,原文還有一些更詳細的信息。如果你只是編譯PWlib,看此文應該把成功編譯。但機器要好一點,我在Duron600, 128M的內存上跑了差不多半小時,才編譯完。
? 祝大家好運。
前言:
? ? ? ?本文只提供VC6.0的編譯說明,如果想知道VC.Net下的編譯過程請參看原文
原文:
? ? ? ?http://www.voxgratia.org/docs/openh323_windows.html
作者 :Craig Southeren
翻譯 ?: Richard
原文更新日期:2004年11月16日
1.介紹
? ? ?這是一篇徹底講解如何用MSVC6.0建立Openh323的文章。這個篇文章是上一篇文章的延續,所以你需要在上篇文章的基礎才能建立Openh323的工程。
2.首要條件。
? ? ?如果要編譯Openh323需要以下條件:
? ? ?1. ? 安裝有MSVC6.0或VS.net2003(本文沒有.net下編譯的介紹)
? ? ? ? 2. ? 一個以編譯的PWlib的環境。
? ? ?3. ? 一個Openh323源代碼的壓縮包,
? ? ?4. ? 解壓工具,類似于winzip。
3.下載和安裝Openh323源代碼。
? ? ? 你可以從這里下載Openh323的源碼。
4.配置文件夾
? ? ? ?在VC中"option"菜單中選擇"tools"菜單,然后按照下面的要求加文件夾:
? ? ? ?1.把Installldir/OpenH323/Include加入頭文件列表中。
? ? 2.把Installdir/OpenH323/Lib加入執行文件列表中。
? ? ? 3.把Installdir/OpenH323/Lib加到庫文件列表中。
5.編譯
? ? ? ? 不管你怎么樣配制的環境,有一許多不同的工程你需要編譯,在OpenH323庫中你有三種不同的方法進行編譯:
? ? ? ? 1.Debug版--------有全部的debug符號和跟蹤信息。它提供了很多的信息,但是一般輸出文件也是最大的。
? ? ? ? 2.Release版--------沒有debug符號,但是有全部跟蹤信息,它的輸出文件比Debug版小,但是它有完全的跟蹤信息日志輸出。
? ? ? ? 3.No Trace版-------沒有debug符號,也沒有跟蹤信息信息,它的輸出文件最小,但是沒有跟蹤的日志輸出。
? ? ? ?注:插件程序只能編譯成Release版,并且它的調試信息不能在運行時使用。
工程名 ? ? ? ? 描述 debug版生成的文件 ? ? ? Release版 ? ? ? ? ?No trace版
OpenH323Lib Openh323的靜態庫 ? ? ?open323sd.lib ?open323s.lib ? ? ?open323sn.lib
OpenH323dll ? ? ? ? ? ?Openh323動態庫 ? ? openh323d.lib ? ? ? ? openh323.lib ? ? ? openh323n.lib
g726 ? ? ? ? ? ? ? ? ? ? ? ?語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? g726codec.dll ? ? ? ? ? ? ?N/A
gsm0610 ? ? ? ? ? ? ? ? 語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? ?gsm0610.dll ? ? ? ? ? ? ? ?N/A
ilbccodec ? ? ? ? ? ? ? ? ?語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? ilbccodec.dll ? ? ? ? ? ? ? ? N/A
IMA_ADPCM ? ? ? ? ? ? 語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? IMA_ADPCM.dll ? ? ? ? ? ? N/A
Speex ? ? ? ? ? ? ? ? ? ? ?語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? ? speexcodec.dll ? ? ? ? ? N/A
LPC_10 ? ? ? ? ? ? ? ? ? ?語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? ? LPC_10.dll ? ? ? ? ? ? ? ? N/A
VoiceAgeG729 ? ? ? ? 語音編解碼插入件 ? ? ? ? ? N/A ? ? ? ? ? ? ? ? ? ? ? ?VoiceAgeG729.dll ? ? ?N/A
? 注:Openh323的靜態庫可以單獨編譯,而動態庫需要從pwlib Release版中生成 MERGESYM工具的支持。語音編解碼dll不需要MERGESYM的支持。
MSVC編譯過程:
?1.打開installdir/OPENH323/OPENH323.DSW。
?2.選擇Workspace中的"File View"
? 3.在編譯工具欄中選擇編譯類型"Win32 Release", "Win32 Debug" 或 "Win32 No Trace"
? 4.右擊"OpenH323Lib files"中菜單中選擇"Build",編譯OPenH323lib,你將會看到如下的輸出:
--------------------Configuration: OpenH323Lib - Win32 Release--------------------
Configuring Build Options
Searching C:/
Searching D:/
Located ffmpeg RFC2190 AVCODEC Library at D:/rfc2190avcodec.dll/
Audio Software Codecs enabled
Video System enabled
ffmpeg RFC2190 AVCODEC Library enabled
Quicknet Internet xJACK cards enabled
Configuration completed.
Compiling...
precompile.cxx
Compiling...
channels.cxx
? ...lines deleted...
transmitter.cxx
vid_coder.cxx
Generating Code...
Creating library...
OpenH323s.lib - 0 error(s), 0 warning(s)
? ? 5.右擊"OpenH323dll files"選擇"bulid"你,編譯Openh323dll,你將會看到如下的輸出:
? ? --------------------Configuration: OpenH323dll - Win32 Release--------------------
Merging exported library symbols
MergeSym version 1.4.0 on Windows 2000 by Equivalence
Compiling resources...
Compiling...
dllmain.cxx
Linking...
Creating library lib/OpenH323.lib and object lib/OpenH323.exp
Extracting debug symbols
REBASE: Total Size of mapping 0x00570000
REBASE: Range 0x30000000 -0x30570000
OpenH323.dll - 0 error(s), 0 warning(s)
在Openh323工程文件中,剩下的是編解碼項目和例子程序,大家可以隨意建立
總結
以上是生活随笔為你收集整理的在Window下编译OpenH323的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: predict_16x16[i_mode
- 下一篇: C# Winform实现捕获窗体最小化、