This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
DynaLoader.pm :-- # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed.
my $libref = dl_load_file($file, $module->dl_load_flags) or croak("Can't load '$file' for module $module: ".dl_error());
######################## This is my build:-
############ This is my example.i
/* File : example.i */ %module example %{ /* Put headers and other declarations here */ #include "example.h" %}
extern double My_variable; extern int fact(int); extern int my_mod(int n, int m);
####################### This is my example.c
/* File : example.c */ #include "example.h"
/* Compute factorial of n */ int fact(int n) { if (n <= 1) return 1; else return n*fact(n-1); }
/* Compute n mod m */ int my_mod(int n, int m) { return(n % m); }
######################### This is my example.h
extern double My_variable; extern int fact(int); extern int my_mod(int n, int m);
########################### This is my Makefile
OBJS=example.o example_wrap.o TARGET=example.dll
CCOPTS= -I/usr/lib/perl5/5.8/cygwin/CORE/ LDOPTS= -L/usr/lib/perl5/5.8/cygwin/CORE/ -lperl -lpthread -lm -lc SWIGOPTS=-perl5 LD=ld CC=gcc SWIG=swig
all $(TARGET) : $(OBJS) $(LD) -shared -o $(TARGET) $(OBJS) $(LDOPTS)
example_wrap.c : example.i $(SWIG) $(SWIGOPTS) $<
clean : rm -rf *.o *.a *.dll example_wrap.c example.pm
.c.o : $(CC) -c $(CCOPTS) $<
################################# This is my test_example.pl
#!/usr/bin/perl -w use strict; use example; print example::fact(4), "\n"; print example::my_mod(23,7), "\n"; print $example::My_variable + 4.5, "\n";
############################# I attach cygcheck.out
############################# Any help would be welcome. Brian Woodroffe brian_woodroffe@bigfoot.com
Attachment:
cygcheck.out
Description: Binary data
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |