[xsd-users] Compiling samples on Mac OS X with Clang

Ovanes Markarian om_codesynthesis at keywallet.com
Thu May 23 19:07:21 EDT 2013


Hello Boris,

many thanks for your prompt support. Please see the issues below:

On Fri, May 24, 2013 at 12:50 AM, Boris Kolpackov
<boris at codesynthesis.com>wrote:

> Hi Ovanes,
>
> Ovanes Markarian <om_codesynthesis at keywallet.com> writes:
>
> > was going to give XSD a try. My dev platform is Mac OS X. I am interested
> > in C++/Parser with an expat binding (no Xerces). I ran the following line
> > for the example located in examples/cxx/parser/hello
> >
> > hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I
> > /usr/local/include" LDFLAGS="-L /usr/local/lib"
> > ../../../build/cxx/compilers.make:108: unknown C++ compiler signature
>
> Stock XSD 3.3.0 doesn't recognize Clang. However, there is a patch that
> adds this support:
>
> http://www.codesynthesis.com/~boris/tmp/xsd/xsd-3.3.0-gcc-4.7-clang.patch
>
> Simply apply it to stock xsd-3.3.0 binary distribution like this:
>
> cd xsd-3.3.0-i686-macosx
> patch -p1 <.../xsd-3.3.0-gcc-4.7-clang.patch
>
> After that everything should build and run without any issues.


I did it as suggested:
xsd-3.3.0-i686-macosx $ patch -p1 < ../xsd-3.3.0-gcc-4.7-clang.patch
patching file examples/build/cxx/compilers.make
patching file examples/build/cxx/rules.make
patching file libxsd/xsd/cxx/parser/expat/elements.txx
patching file libxsd/xsd/cxx/parser/non-validating/parser.txx
patching file libxsd/xsd/cxx/parser/non-validating/xml-schema-pskel.txx
patching file libxsd/xsd/cxx/parser/validating/parser.txx
patching file libxsd/xsd/cxx/parser/validating/xml-schema-pskel.txx
patching file libxsd/xsd/cxx/tree/parsing.txx
patching file libxsd/xsd/cxx/tree/stream-extraction.hxx
patching file libxsd/xsd/cxx/zc-istream.txx
mbprr:xsd-3.3.0-i686-macosx $ cd examples/cxx/
parser/ tree/
mbprr:xsd-3.3.0-i686-macosx $ cd examples/cxx/tree/hello/
mbprr:hello $ ll
total 40
drwxr-xr-x@  7 ovanes  staff   238 Apr 26  2010 .
drwxr-xr-x@ 20 ovanes  staff   680 Apr 26  2010 ..
-rw-r--r--@  1 ovanes  staff   818 Jul 29  2007 README
-rw-r--r--@  1 ovanes  staff   718 Jul 23  2007 driver.cxx
-rw-r--r--@  1 ovanes  staff   391 Jan 27  2006 hello.xml
-rw-r--r--@  1 ovanes  staff  1408 Jul 23  2007 hello.xsd
-rw-r--r--@  1 ovanes  staff   372 Jan 27  2006 makefile
mbprr:hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I
/usr/local/include" LDFLAGS="-L /usr/local/lib"
../../../build/cxx/compilers.make:122: unknown C++ compiler signature
'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target:
x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway
../../../../bin/xsd cxx-tree  hello.xsd
clang++ -I /usr/local/include -I../../../../libxsd  -c driver.cxx -o
driver.o
In file included from driver.cxx:8:
In file included from ./hello.hxx:58:
../../../../libxsd/xsd/cxx/xml/char-utf8.hxx:13:10: fatal error:
'xercesc/util/XercesDefs.hpp' file not found
#include <xercesc/util/XercesDefs.hpp> // XMLCh
         ^
1 error generated.
make: *** [driver.o] Error 1

I installed expat using Homebrew into /usr/local{include,lib} and also pass
these paths to compiler. As you can see with no luck.


Many thanks,
Ovanes


More information about the xsd-users mailing list