[Xapian-devel] Problems building PHP extension for Xapian bindings on Windows

Olly Betts olly at survex.com
Sat Sep 30 17:23:08 BST 2006


On Fri, Sep 29, 2006 at 03:10:13PM +0100, Charlie Hull wrote:
> I've been attempting to build the PHP bindings on Windows using Visual 
> C++ and have run into some serious problems. I thought I'd let everyone 
> know in case someone can suggest a solution. I'm using the Visual C++ 
> 2003 toolkit, the Platform SDK, PHP 4.4.3 sources and the PHP 4.4.3 
> Windows binaries, and the attached make file.

I'd suggest attacking a simpler problem first, to try to narrow down
where the problem(s) lie.

Can you build a simple SWIG generated PHP extension using the same set
of tools?  There are some examples in the SWIG source tree which would
probably serve as a useful test.

> 3. After some research I found various information suggesting that it's 
> difficult to export bits of the STL in a DLL, although Microsoft 
> suggests it's possible in a very messy way:
> http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b168958

I don't see where we try to export an STL class from xapian-core.
Methods accept/return std::string, etc but that's not the same as
exporting std::string, etc unless I misunderstand what's meant by
"exporting".  Perhaps I'm missing something here.

> Someone else said 'The STL is a way to share code, so is a DLL - but 
> they don't play nice together'.

I'm not sure I really believe that, since I've not heard of problems
using Xapian in a DLL in other cases.

But you could just link xapian-core into the PHP module - then none of
the exported functions will involve the STL at all.

Cheers,
    Olly



More information about the Xapian-devel mailing list