[Xapian-discuss] Error compiling Perl bindings

Francis Irving francis at flourish.org
Mon Dec 5 19:36:10 GMT 2005


On Mon, Dec 05, 2005 at 07:11:08PM +0000, Olly Betts wrote:
> On Mon, Dec 05, 2005 at 06:51:07PM +0000, Francis Irving wrote:
> > I'm installing Search-Xapian-0.9.2.2 (from
> > http://search.cpan.org/~kilinrax/Search-Xapian-0.9.2.2/Xapian.pm)
> > on top of xapian-core-0.9.2
> > 
> > I get the following errors:
> > 
> > g++ -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"0.9.2.1\" -DXS_VERSION=\"0.9.2.1\" -fPIC "-I/usr/lib/perl/5.8/CORE"   Xapian.c
> 
> This seems to think it's 0.9.2.1 not 0.9.2.2 (could be Alex failed to
> update the version, or it could be you aren't using the version you
> think you are).

I've checked, and I think Alex failed to update the version.
 
> > XS/WritableDatabase.xs: In function ???void XS_Search__Xapian__WritableDatabase_new3(PerlInterpreter*, CV*)???:
> > XS/WritableDatabase.xs:32: error: ???InMemory??? has not been declared
> > /usr/include/fcntl.h:76: error: too few arguments to function ???int open(const char*, int, ...)???
> > XS/WritableDatabase.xs:32: error: at this point in file
> > XS/WritableDatabase.xs:32: error: no match for ???operator=??? in ???* RETVAL = open(<expression error>)???
> > /usr/local/include/xapian/database.h:261: note: candidates are: void Xapian::WritableDatabase::operator=(const Xapian::WritableDatabase&)
> > make: *** [Xapian.o] Error 1
> 
> Well, my guess from the information here would be it's GCC 4.0.1 being
> fussier about C++ syntax.
> 
> What does "g++ -v" report?

gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
It also seems to go wrong with g++-3.4 and g++-3.3

Just realised I'm being a bit silly - the error is because I compiled
Xapian without the in memory database. That in turn was because I got
the below errors when compiling xapian-core-0.9.2.

They look like things g++-4.0 is being fussy about. If I add
"class InMemoryDatabase;" just above the class definition 
    class InMemoryPostList : public LeafPostList {
backends/inmemory/inmemory_database.h, that seems to fix it.

 g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../common -I../../include -Wall -W -Wredundant-decls -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wno-multichar -Wno-long-long -fno-gnu-keywords -g -O2 -MT inmemory_database.lo -MD -MP -MF .deps/inmemory_database.Tpo -c inmemory_database.cc  -fPIC -DPIC -o .libs/inmemory_database.o
inmemory_database.h:139: error: ISO C++ forbids declaration of 'type name' with no type
inmemory_database.h:139: error: missing '>' to terminate the template argument list
inmemory_database.h:139: error: template argument 1 is invalid
inmemory_database.h:139: error: expected ';' before '>' token
inmemory_database.h:141: error: ISO C++ forbids declaration of 'type name' with no type
inmemory_database.h:141: error: missing '>' to terminate the template argument list
inmemory_database.h:141: error: template argument 1 is invalid
inmemory_database.h:141: error: expected ',' or '...' before '>' token
inmemory_database.h:171: error: ISO C++ forbids declaration of 'type name' with no type
inmemory_database.h:171: error: missing '>' to terminate the template argument list
inmemory_database.h:171: error: template argument 1 is invalid
inmemory_database.h:171: error: expected ';' before '>' token
inmemory_database.h:175: error: ISO C++ forbids declaration of 'type name' with no type
inmemory_database.h:175: error: missing '>' to terminate the template argument list
inmemory_database.h:175: error: template argument 1 is invalid
inmemory_database.h:175: error: expected ',' or '...' before '>' token
inmemory_database.cc:79: error: prototype for 'InMemoryPostList::InMemoryPostList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, const InMemoryTerm&)' does not match any in class 'InMemoryPostList'
inmemory_database.h:126: error: candidates are: InMemoryPostList::InMemoryPostList(const InMemoryPostList&)
inmemory_database.h:142: error:                 InMemoryPostList::InMemoryPostList(int)
inmemory_database.cc: In constructor 'InMemoryPostList::InMemoryPostList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, const InMemoryTerm&)':
inmemory_database.cc:84: error: class 'InMemoryPostList' does not have any field named 'db'
inmemory_database.cc: In member function 'virtual Xapian::doclength InMemoryPostList::get_doclength() const':
inmemory_database.cc:153: error: 'db' was not declared in this scope
inmemory_database.cc: At global scope:
inmemory_database.cc:182: error: prototype for 'InMemoryTermList::InMemoryTermList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, Xapian::docid, const InMemoryDoc&, Xapian::doclength)' does not match any in class 'InMemoryTermList'
inmemory_database.h:163: error: candidates are: InMemoryTermList::InMemoryTermList(const InMemoryTermList&)
inmemory_database.h:177: error:                 InMemoryTermList::InMemoryTermList(int)
inmemory_database.cc: In constructor 'InMemoryTermList::InMemoryTermList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, Xapian::docid, const InMemoryDoc&, Xapian::doclength)':
inmemory_database.cc:184: error: class 'InMemoryTermList' does not have any field named 'db'
inmemory_database.cc: In member function 'virtual Xapian::doccount InMemoryTermList::get_termfreq() const':
inmemory_database.cc:205: error: 'db' was not declared in this scope
inmemory_database.cc: In member function 'virtual OmExpandBits InMemoryTermList::get_weighting() const':
inmemory_database.cc:223: error: 'db' was not declared in this scope
inmemory_database.cc: In member function 'virtual Xapian::PositionIterator InMemoryTermList::positionlist_begin() const':
inmemory_database.cc:256: error: 'db' was not declared in this scope
inmemory_database.cc: In member function 'virtual LeafPostList* InMemoryDatabase::do_open_post_list(const std::string&) const':
inmemory_database.cc:283: error: no matching function for call to 'InMemoryPostList::InMemoryPostList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, const InMemoryTerm&)'
inmemory_database.h:142: note: candidates are: InMemoryPostList::InMemoryPostList(int)
inmemory_database.h:126: note:                 InMemoryPostList::InMemoryPostList(const InMemoryPostList&)
inmemory_database.cc: In member function 'virtual LeafTermList* InMemoryDatabase::open_term_list(Xapian::docid) const':
inmemory_database.cc:349: error: no matching function for call to 'InMemoryTermList::InMemoryTermList(Xapian::Internal::RefCntPtr<const InMemoryDatabase>, Xapian::docid&, const InMemoryDoc&, Xapian::doclength)'
inmemory_database.h:177: note: candidates are: InMemoryTermList::InMemoryTermList(int)
inmemory_database.h:163: note:                 InMemoryTermList::InMemoryTermList(const InMemoryTermList&)

Thanks Olly for your quick response!

Francis



More information about the Xapian-discuss mailing list