How To Build Arabica
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 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 receive Makefiles or project files for other platform+compiler combinations. The release include donated CMake files, if that's your kind of thing.
Arabica builds on an existing XML parser, so 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 any kind of recent Unix type box, you probably have libxml2 or expat already installed. If you're working on Windows, using MSXML is the easiest choice. If you want to use the Arabica's XPath or XSLT facilities, you will also need Boost, release 1.33 or later.
- If you've pulled the source from GitHub, you'll need to start with
autoreconf, otherwise go directly to ...
make checkto run the tests
./configure checks for installed parsers, Boost, and so on and so forth. If you want to choose on parser over another, having things installed in unusual locations, or whatever, you might need to give it a hand. Running
./configure --help will give the many and varied options you can feed it.
I have access Visual Studio 2012 so the distribution includes project files for that IDE. Solution and project files for earlier versions are also included or can be generated from the script provided. I can't guarantee the results, but they've worked reliably for me.
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.
Building Arabica isn't hard, but you might need to get your hands ever so slightly dirty.Visual Studio 2012
- Choose your parser (or parsers) as detailed above.
- Unzip the Arabica source.
- Open vs2012/Arabica.sln and find the Arabicalib project. If you're not interested in XPath or XSLT load Arabica_noboost.sln instead.
- The parsers that Arabica.lib compiles in are controlled by ArabicaConfig.hpp. 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 the 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 directoryyou 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.
- For bonus points now load and compile Arabica_tests.sln as well. It'll spit out a load of test executables in bin.