http://www.perlmonks.org?node_id=797851

Boldra has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to install Devel::Declare to use MooseX::Declare on cygwin perl 5.10 and hitting a g++ compiler error.
Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lCheck Writing Makefile for Devel::Declare cp lib/Devel/Declare/Context/Simple.pm blib/lib/Devel/Declare/Context/ +Simple.pm cp lib/Devel/Declare.pm blib/lib/Devel/Declare.pm cp lib/Devel/Declare/MethodInstaller/Simple.pm blib/lib/Devel/Declare/ +MethodInstaller/Simple.pm /usr/bin/perl5.10.0.exe "-Iinc" /usr/lib/perl5/5.10/ExtUtils/xsubpp - +typemap /usr/lib/perl5/5.10/ExtUtils/typemap Declare.xs > Declare.xs +c && mv Declare.xsc Declare.c gcc -c -I/usr/lib/perl5/site_perl/5.10/i686-cygwin/B/Hooks/OP/Check/I +nstall -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing +-pipe -I/usr/local/include -DUSEIMPORTLIB -O3 -DVERSION=\"0.005011\ +" -DXS_VERSION=\"0.005011\" "-I/usr/lib/perl5/5.10/i686-cygwin/CORE" + Declare.c Running Mkbootstrap for Devel::Declare () chmod 644 Declare.bs rm -f blib/arch/auto/Devel/Declare/Declare.dll g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,- +-stack,8388608 -Wl,--enable-auto-image-base -L/usr/local/lib Declare. +o -o blib/arch/auto/Devel/Declare/Declare.dll \ /usr/lib/perl5/5.10/i686-cygwin/CORE/libperl.dll.a \ Declare.o:Declare.c:(.text+0x6589): undefined reference to `_hook_op_c +heck' Declare.o:Declare.c:(.text+0x65a2): undefined reference to `_hook_op_c +heck' Declare.o:Declare.c:(.text+0x65bd): undefined reference to `_hook_op_c +heck' collect2: ld returned 1 exit status make: *** [blib/arch/auto/Devel/Declare/Declare.dll] Error 1 FLORA/Devel-Declare-0.005011.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
I have never had a good relationship with C compilers. Can someone suggest a way forwards? Does anyone know of a cygwin binary package I can use? Or what I could google for?

I also had some problems with the permissions, +x was missing on "/usr/lib/perl5/5.10/i686-cygwin" and some subdirectories. I fixed this, and this doesn't look like a permission problem any more.

Thanks!



- Boldra
  • Comment on Devel::Declare for cygwin; "undefined reference to '_hook_op_check'"
  • Download Code

Replies are listed 'Best First'.
Re: Devel::Declare for cygwin; "undefined reference to '_hook_op_check'"
by syphilis (Archbishop) on Sep 28, 2009 at 09:21 UTC
    Note (probably harmless): No library found for -lCheck

    I don't know anything about this distro, but could that be the reason for the linking failures ?
    If libCheck is really required, then the fact that it can't be found is certainly not "harmless".

    Cheers,
    Rob
Re: Devel::Declare for cygwin; "undefined reference to '_hook_op_check'"
by Anonymous Monk on Sep 28, 2009 at 08:39 UTC
    Upgrade ExtUtils::Depends , reinstall (critical) B::Hooks::OP::Check , then install Devel::Declare
      ExtUtils::Depends was at 0.302, the latest I could find on CPAN, and from your suggestion I've tried reinstalling B::Hooks::OP::Check both via cpan> force install ... and downloading the tgz and installing with make install, but in the end I'm still getting the same error.

      You certainly sound like you know what your talking about, so I'd be very happy if you had any further suggestions!



      - Boldra
        If there are still people needing this help (I did), here is THE fix: start up cygwin setup.exe. search for check. You will (should) find one in Devel. It is: check: unit test framework for C Install that and your build problems for this will go away.
Re: Devel::Declare for cygwin; "undefined reference to '_hook_op_check'"
by Anonymous Monk on Sep 20, 2013 at 13:54 UTC
    1. cpanm App::pmuninstall
    2. pm-uninstall ExtUtils::Depends B::Hooks::OP::Check
    3. cpanm ExtUtils::Depends
    4. cpanm -v B::Hooks::OP::Check

    capture the full path of CORE/cygperl5_14.dll
    capture the full path of B/Hooks/OP/Check/Check.dll

    5. cpanm --look Devel::Declare --mirror http://search.cpan.org/CPAN
    6. perl Makefile.PL
    7. make

    You will see error from the g++ command. copy it and modify it like below and run it.

    g++-4 --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector Declare.o -o blib/arch/auto/Devel/Declare/Declare.dll \
    ## Replace with full path
    --> CORE/cygperl5_14.dll \
    --> B/Hooks/OP/Check/Check.dll

    Press Enter without Error then you are good to move forward to test and install

    Finally,

    make test
    make install