How To Build Arabica
Building Arabica isn't hard, but it can be a little fiddly.
First, you will need to have at least one of the following parsers installed - Expat, Libxml2, Xerces or if you're on a Windows platform MSXML. If you're working on a Linux box, you probably have libxml or expat already installed. If you're working on Windows, using MSXML is the easiest choice. It's entirely possible to build in support for several parsers, but you'll probably only want one. Depending on exactly which parts of Arabica you are using, you will also need Boost, release 1.33 or later.
Next you need to build the SAX library, configuring it for your choice of parser, or parsers. If you're on some kind of Unix-like platform look here, and if you're using Windows go here. For other platforms you'll have to wing it I'm afraid, but hopefully these instructions and the various Makefiles should provide sufficient clues to get you going. I'm also happy to help as best I can, so do ask. I'd also be delighted to recieve Makefiles or project files for other platform+compiler combinations.
Once the SAX library is built, the DOM and XPath libraries is simplicity itself. You don't have to do anything! They're all headers files. If you want to use it, just include the appropriate parts, link the SAX library, and you're done.
Building on Unix
- In an ideal world you'd just do
./configureand be done with it.Unfortunately, at the moment the dark recesses of template meta-programming are as nothing to getting autoconf going. One day ...That day is here! ./configuremake- Optionally
make install
Building on Windows
I have access to Visual C++ 2003, so the distribution includes project files for that IDE. Unfortunately my clients don't seem to use Borland tools any more, so I'm not up to date with C++Builder, or any of the other IDEs about.
Visual C++ 2003 and 2005- Choose your parser (or parsers) as detailed above.
- Unzip the Arabica source.
- Open vs7/Arabica.sln or vs8/Arabica.sln and find the Arabicalib project.
- The parsers that Arabica.lib compiles in are controlled by ArabicaConfig.h. This header is generated from ArabicaConfig.S using the preprocessor. To set up your choice of parsers, select ArabicaConfig.S, right-click to bring up the menu and select Properties. This brings up the property pages for ArabicaConfig.S. Open out the folders until you find Custom Build Step, then select the Command Line setting. It should look like
. Hit the little button at the end there to bring up the Command Line edit box. - Add /D USE_parser for each parser you want to support. The choices are USE_MSXML (the default), USE_EXPAT, USE_LIBXML2, USE_XERCES. Hit OK, then hit OK on the property pages.
- Now hit F7 to build everything.
- If you see errors like
fatal error C1083: Cannot open include file: 'expat.h': No such file or directory
you need to adjust your include paths. Select the Tools menu, then Options .... Scroll down the list of folders to Projects. Open it up and choose VC++ Directories. Toggle the Show directories for: box to Include files. What a hassle. You should be looking at something like
. Add the path (or paths) the header files for your chosen parsers. While your header, toggle the drop-down from Include files to Library files and add those paths too. If you're using MSXML there is no library file, so you can skip that step. - Everything should now build through, and Arabica.lib should turn up in the lib directory.
- The example_* projects are all little sample applications built on Arabica.lib. They should now build through, and you'll find them in the bin directory. If you get link errors, check the library paths you set up earlier. That's it. Have a play with the sample apps and off you go. If you get DLL not found errors, make sure your parser is on the PATH.
