Monthly Archives: September 2005

xerces-c-src_2_6_0 on Mac OS X Tiger

Issue

When I tried to compile Xerces-C++ Version 2.6.0 from source on Mac OS X Tiger 10.4.2 with gcc-4.0.0 the compiler complained:

MacOSUnicodeConverter.cpp:78: error: 'static' may not be used when defining 
(as opposed to declaring) a static data member
MacOSUnicodeConverter.cpp:84: error: 'static' may not be used when defining 
(as opposed to declaring) a static data member
make[2]: *** [MacOSUnicodeConverter.o] Error 1
make[1]: *** [transcoders] Error 2
make: *** [Util] Error 2

Solution

The solution is easy, just delete the word static in the source code manually and build again or use this patch:

xerces-c-src_2_6_0-tiger.diff

Patch instructions

Download the Xerces-C++ source distribution from [1].

The sources contained in my case version 2.6.0.

Extract sources and apply patch:

tar xzf xerces-c-current.tar.gz
cd xerces-c-src_2_6_0
patch -p1 <../xerces-c-src_2_6_0-tiger.diff

Please make sure that the paths are adjusted to your system. Follow the official build instructions Building Xerces-C++ from the Mac OS X command line at [2] afterwards.