in reply to Re: KinoSearch Installation errors
in thread KinoSearch Installation errors

It doesn't appear to be Windows-compatible

Interestingly, there are two separate sections in FSDirHandle.c:

/********************************** UNIXEN *************************** +******/ #ifdef CHY_HAS_DIRENT_H #include <dirent.h> FSDirHandle* FSDH_do_open(FSDirHandle *self, const CharBuf *dir) { char *dir_path_ptr = (char*)CB_Get_Ptr8(dir); DH_init((DirHandle*)self, dir); self->sys_dir_entry = NULL; self->fullpath = NULL; self->sys_dirhandle = opendir(dir_path_ptr); ...

and

/********************************** Windows ************************** +******/ #elif defined(CHY_HAS_WINDOWS_H) #include <windows.h> FSDirHandle* FSDH_do_open(FSDirHandle *self, const CharBuf *dir) { ...

but apparently, the ifdefs haven't been figured out correctly...

Replies are listed 'Best First'.
Re^3: KinoSearch Installation errors
by ikegami (Patriarch) on Mar 28, 2011 at 19:35 UTC

    I missed that.

    The defines are correct — a dirent.h is present or we'd get an include error — but they're misused. Testing for dirent.h is not what they want to do.

    The OP could change

    #ifdef CHY_HAS_DIRENT_H ...aaa... #elif defined(CHY_HAS_WINDOWS_H) ...bbb... #endif

    to

    #ifdef defined(CHY_HAS_WINDOWS_H) ...bbb... #elif CHY_HAS_DIRENT_H ...aaa... #endif

    (This is a fix for the OP. It's not suitable for incorporation into KinoSearch as is.)

      Thanks, we'll consider that suggestion. The possibility that dirent.h would be present on Windows hadn't been taken into account.

      For what it's worth, official releases of KS have typically been tested under Windows using an MSVC custom-compiled Perl. It used to be that if we could get KS to build and pass tests under MSVC, it would also build and pass tests under Cygwin and Strawberry Perl. Recently, we've been having some difficulties -- but Windows is definitely a target OS, and we look forward to resolving these problems.

        Thanks, we'll consider that suggestion.

        It might break cygwin, or make it behave differently, thus my comment at the bottom.

        Windows is definitely a target OS

        Good to hear. In addition to the OP getting a porting error, my initial assumption that Windows wasn't supported was based on the complete lack of cpan testers reports for the OS. Further checking reveals some for older versions. I guess they haven't gotten around to 0.313 yet.

        I get the same errors as OP with latest mingw And yes, I have
        C:\MinGW\include\dirent.h C:\MinGW\share\libtool\libltdl\lt__dirent.c C:\MinGW\share\libtool\libltdl\libltdl\lt__dirent.h

        I also get a bunch of these warnings

        warning: incompatible implicit declaration of built-in function 'alloc +a'
        which seems to be related to Richard Henderson - Re: Fix implicit declaration warnings for alloca in target files
        On Thu, Sep 16, 2004 at 08:55:50AM -0400, Kaveh R. Ghazi wrote: > +/* GCC always provides __builtin_alloca(x). */ > +#ifndef alloca > +#define alloca(x) __builtin_alloca(x) > +#endif Should be #undef, not #ifndef.
        Creamygoodness....Do you have any solution the issue i've posted? I am really tired and have no idea what's going on. I need KS install on windows XP with Perl 5.8.9 with abysys server on Twiki4.1.0. I am not able to install Text::Iconv even though i have Gnu32 on my machine but don't know why perl Makefile.PL is unable to find out iconv file. Do you think this could be the reason of the KS error?
      What does OP means? One more thing...I also have cygwin install on my machine. Do you think that is the cause of this error?

        "Original Poster", i.e. archimca. (Could also mean "Original Post".)

        No, although you should be able to get it installed using the cygwin perl if you're ok with that. That means you'll have to run that script that needs KinoSearch using the cygwin perl.

      Ok After doing these changes i am getting following errors...
      C:\Temp\newTwikiSearch\KinoSearch-0.313>perl Build Set up gcc environment - 4.5.2 Set up gcc environment - 4.5.2 Set up gcc environment - 4.5.2 Building KinoSearch C:/Perl/bin/MinGW/bin/gcc.exe -c -I"." -I"core" -I"autogen" -I"xs" -I" +charmonize r\src" -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_ +HASH_SEED -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPE +RL_IMPLICI T_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-al +iasing -mm s-bitfields -std=gnu99 -D_GNU_SOURCE -O2 -I"C:\Perl\lib\CORE" -I"\incl +ude" -o "c ore\KinoSearch\Store\FSDirHandle.o" "core\KinoSearch\Store\FSDirHandle +.c" core\KinoSearch\Store\FSDirHandle.c:49:15: warning: extra tokens at en +d of #ifde f directive core\KinoSearch\Store\FSDirHandle.c:170:23: error: #elif with no expre +ssion error building dll file from 'core/KinoSearch/Store/FSDirHandle.c' at +C:/Perl/si te/lib/ExtUtils/CBuilder/Platform/Windows.pm line 130.

        Try

        #ifdef CHY_HAS_WINDOWS_H ...bbb... #elif defined(CHY_HAS_DIRENT_H) ...aaa... #endif

        instead of

        #ifdef defined(CHY_HAS_WINDOWS_H) ...bbb... #elif CHY_HAS_DIRENT_H ...aaa... #endif