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

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.)

Replies are listed 'Best First'.
Re^4: KinoSearch Installation errors
by creamygoodness (Curate) on Mar 28, 2011 at 22:15 UTC

    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.

        The alloca issue may be addressed by this patch, which requires a full rebuild (perl Build realclean; perl Build.PL; perl Build test):

        Index: charmonizer/src/Charmonizer/Probe/Memory.c =================================================================== --- charmonizer/src/Charmonizer/Probe/Memory.c (revision 6525) +++ charmonizer/src/Charmonizer/Probe/Memory.c (revision 6526) @@ -72,7 +72,7 @@ } /* Windows. */ - if (!has_alloca || has_builtin_alloca) { + if (!(has_alloca || has_builtin_alloca)) { sprintf(code_buf, alloca_code, "malloc.h", "alloca"); if (CC_test_compile(code_buf, strlen(code_buf))) { has_malloc_h = true; @@ -81,7 +81,7 @@ ConfWriter_append_conf("#define chy_alloca alloca\n"); } } - if (!has_alloca || has_builtin_alloca) { + if (!(has_alloca || has_builtin_alloca)) { sprintf(code_buf, alloca_code, "malloc.h", "_alloca"); if (CC_test_compile(code_buf, strlen(code_buf))) { has_malloc_h = true;

      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?
Re^4: KinoSearch Installation errors
by Anonymous Monk on Mar 28, 2011 at 20:34 UTC
    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.

Re^4: KinoSearch Installation errors
by archimca (Novice) on Apr 20, 2011 at 19:37 UTC
    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
        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: In function 'kino_FSDH_do_open': core\KinoSearch\Store\FSDirHandle.c:62:5: warning: implicit declaratio +n of funct ion 'opendir' core\KinoSearch\Store\FSDirHandle.c:62:25: warning: assignment makes p +ointer fro m integer without a cast core\KinoSearch\Store\FSDirHandle.c: In function 'kino_FSDH_next': core\KinoSearch\Store\FSDirHandle.c:75:35: warning: implicit declarati +on of func tion 'readdir' core\KinoSearch\Store\FSDirHandle.c:83:35: error: dereferencing pointe +r to incom plete type core\KinoSearch\Store\FSDirHandle.c:87:38: error: dereferencing pointe +r to incom plete type core\KinoSearch\Store\FSDirHandle.c:91:52: error: dereferencing pointe +r to incom plete type core\KinoSearch\Store\FSDirHandle.c: In function 'kino_FSDH_entry_is_s +ymlink': core\KinoSearch\Store\FSDirHandle.c:143:36: error: 'S_IFLNK' undeclare +d (first u se in this function) core\KinoSearch\Store\FSDirHandle.c:143:36: note: each undeclared iden +tifier is reported only once for each function it appears in core\KinoSearch\Store\FSDirHandle.c: In function 'kino_FSDH_close': core\KinoSearch\Store\FSDirHandle.c:160:9: warning: implicit declarati +on of func tion 'closedir' error building dll file from 'core/KinoSearch/Store/FSDirHandle.c' at +C:/Perl/si te/lib/ExtUtils/CBuilder/Platform/Windows.pm line 130.