Subject: | Cygwin build error and workaround for Devel::Declare |
Building Devel::Declare on cygwin usually ends with the build error:
Declare.o:Declare.c:(.text+0x855): undefined reference to `_hook_op_check'
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Devel/Declare/Declare.dll] Error 1
during this step:
g++ --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 \
/home/az/local/perl-5.14.1b/lib/5.14.1/cygwin-64int/CORE/cygperl5_14_\.dll
(your directory names may vary).
I was able to overcome this build error by:
1. Finding the DLL from the installation of the
B::Hooks::OP::Check module, either in the install
dirs or the build dirs.
2. Append the full path of this DLL to the broken g++
command above and run it. Example:
g++ --shared -Wl,--enable-auto-import \
-Wl,--export-all-symbols -Wl,--enable-auto-image-base \
-L/usr/local/lib -fstack-protecor Declare.o \
-o blib/arch/auto/Devel/Declare/Declare.dll \
/home/az/local/perl-5.14.1b/lib/5.14.1/cygwin-64int/CORE/cygperl5_14_1.dll \
/home/az/local/perl-5.14.1b/lib/site_perl/5.14.1/cygwin-
64int/auto/B/Hooks/OP/Check/Check.dll
3. If that command runs successfully, continue with the
build process.
make
make test
make install
I don't have a sense of what it would take to fix this issue
in the Makefile.PL file.
-- Marty O'Brien