syphilis has asked for the wisdom of the Perl Monks concerning the following question:
## Foo.pm ## package Foo; use strict; require Exporter; *import = \&Exporter::import; require DynaLoader; $Foo::VERSION = '0.01'; DynaLoader::bootstrap Foo $Foo::VERSION; @Foo::EXPORT = qw(foo); @Foo::EXPORT_OK = (); sub dl_load_flags {0} # Prevent DynaLoader from complaining and croaki +ng 1; __END__ ## Makefile.PL ## use ExtUtils::MakeMaker; my %options = %{ { 'TYPEMAPS' => [ 'C:\\perl510_M\\5.10.0\\lib\\ExtUtils\\typemap' ], 'NAME' => 'Foo', 'INC' => '-IC:/temp/Foo_build', 'VERSION' => '0.01' } }; WriteMakefile(%options); # Remove the Makefile dependency. Causes problems on a few systems. sub MY::makefile { '' } __END__ ## test.pl ## use Foo; $x = 17; $y = 31; $z = foo($x, $y); if($z == 48){print "ok 1\n"} else {print "not ok 1 $z\n"} __END // Foo.xs // #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int foo(int x, int y) { return x + y; } MODULE = Foo PACKAGE = Foo PROTOTYPES: DISABLE int foo (x, y) int x int y
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [XS on Win32] How to have the extension's dll export its symbols.
by BrowserUk (Patriarch) on Mar 05, 2008 at 11:57 UTC | |
by syphilis (Archbishop) on Mar 05, 2008 at 12:37 UTC | |
by BrowserUk (Patriarch) on Mar 05, 2008 at 12:59 UTC | |
by syphilis (Archbishop) on Mar 05, 2008 at 13:35 UTC | |
by BrowserUk (Patriarch) on Mar 05, 2008 at 14:05 UTC | |
|