[Xapian-discuss] Compiling latest svn revision

Olly Betts olly at survex.com
Wed Dec 3 21:13:44 GMT 2008

On Wed, Dec 03, 2008 at 11:03:27PM +0200, Henry wrote:
> /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o: In function `_start':
> (.text+0x18): undefined reference to `main'
> Xapian.o: In function `boot_Search__Xapian':
> /home/henry/projects/xapian/search-xapian/Xapian.c:8796: undefined  
> reference to `Perl_Gthr_key_ptr'
> /home/henry/projects/xapian/search-xapian/Xapian.c:8796: undefined  
> reference to `pthread_getspecific'
> ....

This is a known issue.  Search::Xapian uses a hack to get libtool to
link against an uninstalled libxapian, which works fine with libtool
1.5.x (which Xapian 1.0.x uses) but fails with libtool 2.2.x (which
trunk now uses).  I think we were just lucky that this ever worked
rather than this being a libtool regression.

> Now, "undefined reference to `main'" usually indicates a missing  
> main() function during linking, so it looks like something wonky is  
> going on.

It's trying to link the perl module as a program IIRC.

> Resolving this in a small project would be relatively easy, but Xapian  
> is no small project :)  Any ideas?

I've prodded this a bit but with no luck so far.

If you install xapian-core and then build Search::Xapian against that,
then that should work - we only use libtool for the uninstalled
xapian-core case.


More information about the Xapian-discuss mailing list