[Xapian-discuss] Compiling problem

Olly Betts olly at survex.com
Wed Dec 29 16:42:34 GMT 2004


On Wed, Dec 29, 2004 at 05:24:50PM +0100, Penz, Bernhard wrote:
> I am compiling Xapian in a non-GNU/GCC environment (windows, that is),
> and run into one minor problem.

What's the compiler?

> The problematic line of code is in backends\quartz\btree.h
> 
> 549:	static const string::size_type max_key_len = BTREE_MAX_KEY_LEN;
> 
> Seems that the gnu compiler is happy with that, although I doubt that
> this is legal C++ syntax.

I'm not familiar enough with the standard to say, but it's also accepted
by Sun's, SGI's, and HP's compilers.

> This line of code causes a linker error
> because Btree:max_key_len gets created multiple times. Proposed
> solution:
> 
> backends\quartz\btree.h:
> 549:	static const string::size_type max_key_len;
> 
> backends\quartz\btree.cc:
> 91 :  const string::size_type Btree::max_key_len = BTREE_MAX_KEY_LEN;

I think just dropping the "static" from btree.h would be preferable if
that works.

> The rest of those parts that I need compile with lots of warnings, but
> only because some typedefs are a bit different on the windows side.

If we can fix warnings without making the code worse, I'm all for it.
Unfortunately some compilers have a few rather stupid warnings which
you can't sensible avoid, except by disabling them.

> Is there any interest on such fixes for non-GNU/GCC environment? If yes,
> I'd be happy to provide patches!

Sure.

Cheers,
    Olly



More information about the Xapian-discuss mailing list