Hello, 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: g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../common -I../include -I../include> -I./harness -I../../xapian-core/include -Wall -W -Wredundant-decls > -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security > -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wshadow -Wstrict-overflow=1 > -Winit-self -Wmissing-declarations -Werror -fvisibility=hidden -g -O2 > -std=gnu++11 -MT harness/cputimer.o -MD -MP -MF $depbase.Tpo -c -o > harness/cputimer.o harness/cputimer.cc &&\ > mv -f $depbase.Tpo $depbase.Po > In file included from harness/cputimer.cc:25: > In file included from ./harness/testsuite.h:29: > In file included from ../common/output.h:39: > ../../xapian-core/include/xapian/database.h:29:3: error: "Never use > <xapian/database.h> directly; include <xapian.h> instead." > # error "Never use <xapian/database.h> directly; include <xapian.h> > instead."Could you please suggest a workaround for this? ---------------------------------------------------------------------------- Kind Regards, Ayush Tomar | My Webpage <http://ayshtmr.xyz> | LinkedIn <https://in.linkedin.com/in/ayushtomar> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20160612/cc965539/attachment.html>
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