Re: Error while setting up tests in xapian-letor
James Aylett <[email protected]>
| Newsgroups | gmane.comp.search.xapian.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Jun 12, 2016 at 06:13:39AM +0530, Ayush Tomar wrote: > While setting up tests module for letor (in xapian-letor/tests; I copied > the entire tests folder from xapian-core), I am getting build errors of the > following type > [...] > > > # error "Never use <xapian/database.h> directly; include <xapian.h> > > instead." To build the testsuite, you need to define XAPIAN_LIB_BUILD as a C preprocessor symbol (this allows you to include parts of the Xapian header system, rather than all of them). xapian-core does this throughout, but you probably want to do this just while building the tests (probably add it to AM_CPPFLAGS in tests/Makefile.am). I think for the testsuite this is mainly for common/output.h, which is basically just creating some overloaded operators so you can easily write Xapian objects to a std::ostream like stderr and have them display sensibly. J -- James Aylett, occasional trouble-maker xapian.org