[Xapian-devel] About bild xapian on windows using mingw32

Scott Zhang macromarship at gmail.com
Thu Apr 28 10:03:35 BST 2011


Hello. All.
   Finally get xapian compiled with mingw on windows 2003.
Following changes need to be made.
1. When configure
do this.
configure CXXFLAGS=-D__MSVCRT_VERSION__==0x0601

2. Modify common/closeform.cc
Line 100:
change
maxfd = static_cast<int>(sysconf(_SC_OPEN_MAX));
to
maxfd = 65535;//static_cast<int>(sysconf(_SC_OPEN_MAX));

because sysconf is not implemented in mingw.

3. modify net/progclient.cc
on Line 25: add
#include <stdio.h>

because sprintf is not defined here.

4. modify net/tcpserver.cc
on line 25. add
on Line 25: add
#include <stdio.h>

because sprintf is not defined here.

Then make && make install

I notice there are some strip function is not success because the path
is incorrect. But it doesn't matter.
Then we can test examples.


Regards.
Scott

On Thu, Apr 28, 2011 at 1:57 PM, Scott Zhang <macromarship at gmail.com> wrote:
> Hello. All.
>   I tried add -D__MSVCRT_VERSION=0x0601 when configure. Now the
> _ftime64 issue is resolved.
>   The compiling run for a long while and now stop on "closeform.cc"
>
> error: 'sysconf' was not declared in this scope.
>
> I googled, looks mingw doesn't have 'sysconf'. How do you work around this?
>
>
> Thanks.
> Regards.
> Scott
>
> On Thu, Apr 28, 2011 at 12:12 PM, Scott Zhang <macromarship at gmail.com> wrote:
>> Helllo.
>>    I am building xapian on windows using mingw32. The configure
>> process works well. when after I typed 'make' and start compiling.
>>  It prompts me:
>> In file included from api/replication.cc:39:0
>> ./common/realtime.h: In function 'double RealTime::now()':
>> ./common/realtime.h:66:22: error: aggregate
>> 'RealTime::now()::__timeb64 tp' has incomplete type and cannot be
>> defined
>> ./common/realtime.h:67:17: error: '_ftime64' was not declared in this scope.
>>
>> How can I resolve this and get xapian compiled?
>>
>> Thanks.
>> Regards.
>> Scott
>>
>



More information about the Xapian-devel mailing list