[Xapian-devel] Remote database & local database, and adding new weight found vtable error

Olly Betts olly at survex.com
Sun Mar 10 10:05:16 GMT 2013


On Tue, Mar 05, 2013 at 03:54:59PM +0800, ?????? wrote:
> Xapian::Database dbr = Xapian::Remote::open(host of DB1, port of DB1, 0, 0);
> Xapian::Database dbr2 = Xapian::Remote::open(host of DB2, port of DB2, 0,
> 0);
> 
>  db.add_database(dbr2);

Don't you mean:

  dbr.add_database(dbr2);

If that's not the issue, I don't think I can tell what's up from the
information you've given.

> Q2.
> I want add a weight scheme into Xapian-1.2.12;
> I have implemented it by add Myweight.cc in ./weight/ with weight.cc, etc.
> and I also added necessary declaration in ./include/xapian/weight.h for
> Myweight.
> 
> by add Myweight.cc into ./weight/Makefile.am I have successfully compiled
> the source code and got the dynamic library.
> 
> But when I call Myweight scheme in my own c++ program, the compiler told me
> that "undefined reference to 'vtable for Xapian::Myweight'".

That sounds like your new file isn't being included.

> I have checked all the virtual function include the destructor and all of
> them were re-implemented in Myweight.cc.

Did you configure with --enable-maintainer-mode?  If not, then the rules
to regenerate the build system are disabled (some platforms have "make"
programs which try to rebuild stuff when it's not appropriate).

You aren't the first to be caught out by this, and we have discussed
changing this so maintainer mode is on by default.  Then we can advise
people to configure with --disable-maintainer-mode or use GNU make if
their platform's make causes problems.  But we haven't made that change
yet.

Incidentally, in case you weren't aware, you don't have to include a new
weighting scheme in the library in order to use it.

Cheers,
    Olly



More information about the Xapian-devel mailing list