Building the OpenH323 Code

 

 Home

 Download
 Search
 Report bugs
 Building
 Contributors
 OEM

 Documents
   FAQ
   H.323 standards
   Tutorial
   Other docs

 Quicknet drivers
   Download
   Build

   CVS
   SDK & Docs

 Mailing list
   How to join
   Archive

 

This page describes how to compile the OpenH323 code release. Note these instructions will always refer to the latest snapshot available on the download page.

The OpenH323 source will have been compiled and tested under Linux x86, and Windows NT. If it does not compile for you then the problem is likely to be a setup/configuration problem with your system and not a problem with the source code itself.

The libraries and applications should also compile on Windows 95/98, BeOS (thanks Yuri!), Linux PPC, FreeBSD x86, OpenBSD x86 (thanks Roger!) and Solaris Sparc & x86. They are not automatically compiled on every release however so there could be problems, but the chances are that there aren't. Note also that not all of these platforms may have ports of the sound interface.

We are also happy to port it to other Unix flavours providing people out there can provide an account and a fair bit of disk space!

These instructions should contain all of the steps need. If you have a problem, please double check that you have performed ALL of the steps below, particularly setting the include file paths under MSVC. Some of the more common errors are described below.

If you get a lot of compile or link errors, then the chances are that you have missed something in the list. If you are positive that something is wrong and you have followed the instructions, then send an e-mail to the mailing list, and we'll answer it for everyone to see.

Finally, the documentation for the library is included in the header files, you can create HTML files from the source using the doc++ package available here.


Windows

The windows build instructions are only for Microsoft DevStudio version 6 at this stage. If you have v5 then you may still build the system but you can not use the DLL's (see FAQ for more info) and there is no guarentee of compatibility in the future. If you have another compiler you are completely on your own!

1. Download the pwlib_1.xx.zip and openh323_1.x.zip files from the OpenH323 download page.
2. Extract the pwlib_1.xx.zip file somewhere eg c:\, making sure the directory structure is preserved.
3. Start MSVC (v5, v6 or v7 (.NET)). If you have another compiler you are on your own! Add these folders to the Include Files path as follows:

In VisualStudio v5/6 go into the Tools menu, Options item, Directories tab.

In VisualStudio v7, go into the Tools menu, Options item. In the Options dialog, open the Projects folder, VC++ Directories item. In the 'Show Directories for:' list, select 'Include files'.

Add to the beginning of the Include files path (note the order is important!):

C:\PWLib\Include\PwLib\MSWIN
C:\PWLib\Include\PtLib\MSOS
C:\PWLib\Include
C:\OpenH323\Include

and add to the Lib Files path and the Executable Files path the following:

C:\PWLib\Lib
C:\OpenH323\Lib

Also make sure these directories are in your PATH environment variable.

The Lib folder is created as parts of PWLib are built. Also add this directory to your PATH environment variable (so PWRC, MergeSym and ASNParser tools can be found).

3a If you have OpenSSL installed and compiled on your system then you can define the following environment variables to get SSL support:

OPENSSLFLAG=1
OPENSSLDIR=c:\somewhere\openssl
OPENSSLLIBS=ssleay32.lib libeay32.lib

If you have not included these variables then you will get a warning during the build. You can safely ignore this warning.

3b If you have EXPAT installed and compiled on your system then you can define the following environment variables to get XML support:

EXPATFLAG=1
EXPATDIR=c:\somewhere\expat
EXPATLIBS=expat.lib

If you have not included these variables then you will get a warning during the build. You can safely ignore this warning.

4. Note you will need bison and flex to compile the system. You can get a copy or the binaries from here, follow the instructions included. It may also be necessary to add this directory to the MSVC executable path.
5. In VisualStudio v5/6 open the pwlib.dsw file in the pwlib top directory.
If you have the minimum library it will come up with several requests to
find .dsp files, just cancel past these.
   
In VisualStudio v7 open the pwlib.sln file in the pwlib top directory.
6. In VisualStudio v5/6 use the Batch Build command and build the "ASNParser - Win32 Release",  "pwtest - Win32 Release" and "pwtest - Win32 Debug" targets. make sure all other targets are not checked. Also make sure you have not checked the "Selection Only" check box.

In VisualStudio v7 use the Batch Build command. It seems as though the batch build does not build dependent parts unless they're checked in the Build column. For a test build, be sure all Projects are checked except ASNParser-debug, MergeSym-debug, PacketVXD-release, PWRC-debug, and both XMLRPC.

7. Extract the contents of the openh323_1.x.zip file somewhere.
8. Use the OpenH323.dsw file to build the Open H.323 and sample code. Use the "SimpH323 - Win32 Release" target and the dependencies should build the OpenH323 DLL's.
9. Run the program, and you are on your own!

Unix

The Unix build instructions are only for GNU C++ v 2.95 or later. If you have an earlier then you may still build the system but there is no guarentee of compatibility in the future. If you have another compiler you are completely on your own!

Note 1: If you require support for the Quicknet cards, then you will require the Linux Telephony component in kernel (2.2.14 or later) for the Quicknet card support to work. You will also need the latest Quicknet drivers for the Quicknet card support to work correctly.

Note 2: If you require video support, make sure you have the latest video drivers installed for your card.


1. Download the pwlib_min_x.xx.tar.gz and openh323_1.xx.tar.gz files from the OpenH323 download page.
2. Extract the pwlib_min_x.xx.tar.gz somewhere, preferably in your home directory, eg:

cd
tar -xzvf pwlib_min_1.14.tar.gz

This should result in a ./pwlib directory tree.

3. If you have not installed PWLib in your home directory (~/pwlib) then you will have to define the environment variable PWLIBDIR to point to the correct directory.

Also make sure you have added the $PWLIBDIR/lib directory to your LD_LIBRARY_PATH environment variable if you intend to use shared libraries (the default under Linux).

There are examples for sh/bash and csh/tcsh.

4. Build the debug and release versions of the PWLib library as follows:

cd $PWLIBDIR
make both

This may take some time. Note, you will need GNU make (>=3.75), bison(>=1.25) and flex (>=2.5.4) for this to compile, most Unix systems have these packages.

WARNING
: there is a bug in most of the bison.simple files.

If you are getting huge numbers of errors from make then you are probably not using the GNU make. FreeBSD and OpenBSD users must install gmake and use gmake instead of make in these instructions. If the errors are during the compile, then it is likely your platform is not supported, or you have incorrectly set the OSTYPE and MACHTYPE variables. There will be a large warning printed about this, don't ignore it!

5. Extract the contents of the openh323_x.x.tar.gz file somewhere, eg:

cd
tar -xzvf openh323_1.1alpha1.tar.gz

6. If you have not installed OpenH323 in your home directory (~/openh323) then you will have to define the environment variable OPENH323DIR to point to the correct directory.

Also make sure you have added the $OPENH323DIR/lib directory to your LD_LIBRARY_PATH environment variable if you intend to use shared libraries (the default under Linux).

There are examples for sh/bash and csh/tcsh.

7. Build the H323 bootstrap code. This will automatically build the ASN compiler (in the $PWLIBDIR/tools/asnparser directory), though this should have already been built previously. Enter:

cd $OPENH323DIR
make opt

This may take some time, especially with the h245_*.cxx and h225.cxx files. You may also need to add more swap space - 64M of real memory and 64M of swap might just be enough, if your machine does nothing else! Some people have reported needing as much as 128M of swap - if your compiler bombs out with a "virtual memory exhausted" error compiling h245_*.cxx and h225.cxx, then increase your swap space.

8. The result should be an executable called simph323, which will be built in a directory dependent on the platform, eg obj_linux_x86_d. To run it, use the following command:

./samples/simple/obj_linux_x86_r/simph323

and you should get the usage help text.

9. Now you're on your own!

Common errors

Here are common errors you might encounter for both Windows and Unix builds.

  • The file h235, h225.h, h245 etc are missing.

A number of files are generated files that are created during the build process. If they are missing then something went wrong with the creation of the asnparser or your installation of flex/bison.

  • The following error:

/home/newbie/pwlib/tools/asnparser/obj_linux_x86_r/asnparser: error in loading
shared libraries: libpt_linux_x86_r.so.1: cannot open shared object file: No
such file or directory

You have not set the LD_LIBRARY_PATH environment variable. Below are examples for some common shells

Example environment for sh/bash:

PWLIBDIR=$HOME/pwlib
export PWLIBDIR
OPENH323DIR=$HOME/openh323
export OPENH323DIR
LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib
export LD_LIBRARY_PATH

Example environment for csh/tcsh:

setenv PWLIBDIR $HOME/pwlib
setenv OPENH323DIR $HOME/openh323
setenv LD_LIBRARY_PATH $PWLIBDIR/lib:$OPENH323DIR/lib
  • The following error:

Linking...
LINK : fatal error LNK1181: cannot open input file "ptlib.lib"
Error executing link.exe.

You have not set the MSVC library paths correctly (Tools->Options->Directories).

  • The following error:

Performing Custom Build Step on ..\common\getdate.y
The name specified is not recognized as an
internal or external command, operable program or batch file.
Error executing c:\winnt\system32\cmd.exe.

You have not installed bison and flex correctly. Check that they are named bison.exe and flex.exe and the directory they are in is in the PATH environment variable. it may also be necessary to add this directory to the MSVC executable path (Tools->Options->Directories).

  • The following error:

Performing Bison Step
c:\tools\share\bison.simple: No such file or directory
C:\PWLIB\TOOLS\ASNPAR~1\BISON.EXE: Cannot move asn_grammar_tab.c - No such file or directory
Cannot move asn_grammar_tab.h - No such file or directory

Indicates you have not installed bison correctly. In particular the bison.simple file must be available to bison. Check the bison documentation for details on this.

  • The following error:

E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(243) : error C2061: syntax error : identifier 'RTP_DataFrame'
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(261) : error C2143: syntax error : missing ',' before '&'
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(261) : error C2059: syntax error : '&'
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(304) : error C2653: 'RTP_DataFrame' : is not a class or namespace name
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(304) : error C2146: syntax error : missing ';' before identifier 'GetRTPPayloadType'
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(304) : error C2501: 'PayloadTypes' : missing storage-class or type specifiers
E:\VOIP\BetaOpenH323\openh323_1_1beta1\openh323\Include\codecs.h(304) : warning C4183: 'GetRTPPayloadType': member function definition looks like a ctor, but name does not match enclosing class

Indicates that you have not set the MSVC include path in the correct order.

  • Attempting to compile GUI systems under Unix.

There are a number of partial implementations of the GUI code in the $PWLIBDIR/src/pwlib directory tree. These are not required to get the OhPhone application compiled. If you get those systems from the CVS then you are basically on your own. Do not ask for support unless you intend to help with the implementation!


Top of page Top
Maintained by webmaster@openh323.org
Logo and site design by jip
Last Modified: 04 Dec 2003 14:10
Copyright 1998-2002 by Equivalence Pty Ltd
A Quicknet Technologies Company
All Rights Reserved, equival@equival.net