[h323plus] Compilation problems.

Paul Chitescu paulc at voip.null.ro
Wed Mar 28 08:43:47 EDT 2012


Hi!

These compilation problems in Yate may be caused by improperly guessing the 
exact include order and defines in the compiler's command line. What makes 
things worse is that the include order is different when compiling against 
installed lib vs source directory.

Both OpenH323 and H323Plus only install some .mak files that are supposed to be 
included form the application's Makefile. Unfortunately that's a bad choice for 
applications using the library as a plugin, not as the main program. Both 
libraries make assumptions about owning the process / primary thread.

The simple and preferred way would be to build at configure time a file for 
pkgconfig. Then other programs can query the include, library, etc. flags during 
their own configure and insert in their Makefiles. If the pkgconfig file is 
missing (old library version) a configure script can fall back to the guessing 
method.

For example in Yate we create both a small yate.pc for use with pkgconfig and a 
more comprehensive yate-config script that can return almost any variable 
detected by Yate's configure script.

Paul Chitescu


On Wednesday 28 March 2012 02:19:40 pm Francisco Olarte (M) wrote:
> When we compile and install OpenH233 (1.24 or HEAD) with an installed
> version of PTLIB (2.10.1) both installed local on a user home dir we end
> with the following directory structure:
>
> $ ls -l ~/include
> total 48
> drwxr-xr-x 9 gay gay  4096 Mar 26 16:55 openh323
> -r--r--r-- 1 gay gay 21475 Feb 29 09:57 ptbuildopts.h
> drwxr-xr-x 2 gay gay  4096 Feb 29 09:57 ptclib
> drwxr-xr-x 3 gay gay  4096 Feb 29 09:57 ptlib
> -r--r--r-- 1 gay gay  4794 Feb 29 09:57 ptlib.h
> drwxr-xr-x 2 gay gay  4096 Mar 26 17:02 yate
>
> When we compila yate, which uses openh323, it includes openh323buildopts.h,
> which it finds in  ~/include/openh323/openh323buildopts.h
>
> This file, in stock form, starts with:
>
>
> #ifndef _OPENH323_BUILDOPTS_H
> #define _OPENH323_BUILDOPTS_H
>
> #include <ptbuildopts.h>
> #include <ptlib/../../revision.h>
>
> #if PTLIB_MAJOR == 2 && PTLIB_MINOR < 10
>    #define PTLIB_VER ( PTLIB_MAJOR*100 + PTLIB_MINOR*10 + PTLIB_BUILD )
> #else
>    #define PTLIB_VER ( PTLIB_MAJOR*1000 + PTLIB_MINOR*10 + PTLIB_BUILD )
> #endif
>
> #define PTLIB_SVN_REVISION  SVN_REVISION
>
> which has two problems, the first one is the   " #include
> <ptlib/../../revision.h> " which does not work ( it would
> resolve to ~/include/ptlib/../../revision.h => ~/revision.h ). It works
> when compiling against the uninstalled version
> of ptlib because it has a file ~/src/ptlib-2.10.1/revision.h ( we unpack in
> ~/src ).
>
> We solve the problem by zapping the offending include.
>
> The second, minor problem, is the "#define PTLIB_SVN_REVISION
> SVN_REVISION" which fails when zapping the include,
> we zap this too and it works.
>
> I think BOTH lines should be deleted, they seem like some kind of testing
> stuff. If we do it after installing every h323plus code
> we compile builds without any problem.
>
> Francisco Olarte.




More information about the h323plus mailing list