[Xapian-discuss] Compiling Xapian within a Cocoa project

Olly Betts olly at survex.com
Fri Apr 26 07:56:59 BST 2013


On Fri, Apr 26, 2013 at 08:45:49AM +0200, Tae Won Ha wrote:
> In file included from /opt/local/include/xapian.h:34:
> In file included from /opt/local/include/xapian/database.h:32:
> In file included from /opt/local/include/xapian/document.h:33:
> /opt/local/include/xapian/valueiterator.h:143:10: error: expected member name or ';' after declaration specifiers
>     bool check(Xapian::docid docid);
>     ~~~~ ^
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/AssertMacros.h:1291:28: note: expanded from macro 'check'
>         #define check(assertion)  __Check(assertion)
>                                   ^

Something in the OS X SDK is defining check() as a macro, which breaks
any code after that which defines or declares a function or method
called check().

The simplest thing to do is to just include <xapian.h> *before* the
problematic header.

If you actually want to call the check() method, you'll need to be
more devious, e.g. you could do this after the problematic header,
though that might cause problems if it's used by other macros from
that header:

#undef check

Cheers,
    Olly



More information about the Xapian-discuss mailing list