gants has asked for the wisdom of the Perl Monks concerning the following question:
Undefined subroutine &Book::Factorial::factorial_iterative_c called at + fact.pl line 3.
everything installed well symbols in factorial.c existent...factorial.h============================ double factorial_recursive_c(int x); double factorial_iterative_c(int +x); factorial.c============================ double factorial_recursive_c(int x) { if (x < 2) return 1; return x * factorial_recursive_c(x - 1); } double factorial_iterative_c(int x) { int i; double result = 1; for (i = 2; i <= x; i++) result *= i; return result; } ============================== $h2xs -n Book::Factorial -A -O -x -F factorial.h add 'OBJECT' => 'Factorial.o factorial.o', to Makefile.PL $perl Makefile.PL $make $make test $make install
23: 00000af0 45 FUNC GLOBAL DEFAULT 12 factorial_iterative +_c 26: 00000aa0 76 FUNC GLOBAL DEFAULT 12 factorial_recursive +_c testing script============================= use strict; use Book::Factorial; my $result = Book::Factorial::factorial_iterative_c(5); print $result;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: own perl module based on c library
by almut (Canon) on Apr 27, 2010 at 12:15 UTC | |
|
Re: own perl module based on c library
by salva (Canon) on Apr 27, 2010 at 12:51 UTC | |
by almut (Canon) on Apr 27, 2010 at 13:49 UTC | |
by gants (Novice) on Apr 28, 2010 at 13:32 UTC |