[Xapian-discuss] "Undefined Reference to" errors

Olly Betts olly at survex.com
Sat Sep 1 09:34:43 BST 2007


On Thu, Aug 30, 2007 at 11:57:22AM +0100, Kwok-yau Kwong wrote:
> kwok at kwok-desktop:~/Desktop/Xapian-Index$ make -f Makefile all
> g++ -c -O3 -g -Wno-deprecated -I/usr/local/include/xapian/
> -I/usr/local/include/ trec_index.cc -o trec_index.o
> g++ -O3 -g -Wno-deprecated config_file.o htmlparse.o stopword.o gunzipper.o
> split.o timer.o trec_index.o /usr/local/lib/libxapian.a -o trec_index

It's better to replace:

    /usr/local/lib/libxapian.a

with (including the ``):

    `/usr/local/bin/xapian-config --libs`

(And if you really want to force static linking, just don't build the
shared libraries at all - configure with --disable-shared).

The purpose of xapian-config is to take care of any special compiler and
linker options for you, so it makes your makefile more portable.

> All errors seem to be related to "inflate" or "deflate". Am i missing
> something?

You didn't link against zlib.  If you use `xapian-config --libs` then
that should happen automatically.

Cheers,
    Olly



More information about the Xapian-discuss mailing list