Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Building a SWIG example on cygwin

by Just in (Sexton)
on Apr 16, 2011 at 14:49 UTC ( [id://899748]=perlquestion: print w/replies, xml ) Need Help??

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

I've written something with Inline which I'm happy with, and I'd like to try using SWIG. I've got strawberry 5.12, cygwin (without the perl distro), Windows 7, and the SWIG zip unzipped without anything else being done (no env vars set etc). Getting as far as the following took a fair bit of trial and error, but I'm now stuck with:

mimi@mimi-PC ~ $ export CYGWIN=nodosfilewarning mimi@mimi-PC ~ $ SRCS=C:/Users/mimi/swig/Examples/perl5/simple/example.c mimi@mimi-PC ~ $ OBJS=C:/Users/mimi/swig/Examples/perl5/simple/example.o mimi@mimi-PC ~ $ LIBPATH="-LC:/strawberry/perl/lib/CORE -LC:/strawberry/c/lib" mimi@mimi-PC ~ $ LIBS=-lperl512 mimi@mimi-PC ~ $ cd C:/Users/mimi/swig/Examples/perl5/simple mimi@mimi-PC /cygdrive/c/Users/mimi/swig/Examples/perl5/simple $ ../../../swig -perl5 example.i mimi@mimi-PC /cygdrive/c/Users/mimi/swig/Examples/perl5/simple $ gcc -c $SRCS mimi@mimi-PC /cygdrive/c/Users/mimi/swig/Examples/perl5/simple $ gcc -shared $OBJS $LIBPATH $LIBS -o example.dll mimi@mimi-PC /cygdrive/c/Users/mimi/swig/Examples/perl5/simple $ perl -Mexample Can't find 'boot_example' symbol in ./example.dll at example.pm line 11 Compilation failed in require. BEGIN failed--compilation aborted.

I have read this which is quite spare on exact detail that I can fathom.

So any help would be highly appreciated.

Replies are listed 'Best First'.
Re: Building a SWIG example on cygwin
by Anonymous Monk on Apr 16, 2011 at 17:39 UTC
    Mixing cygwin and mingw? Why?

      Brain fart? Actually using MakeMaker on DOS is a whole load easier. Here's the steps to a successful build if googling brings you this way:

      C:\Users\mimi\swig\Examples\perl5\simple>type makefile.pl use ExtUtils::MakeMaker; WriteMakefile( NAME => 'example', # Name of package LIBS => ['-lm'], # Name of custom libraries OBJECT => 'example.o example_wrap.o' # Object files ); C:\Users\mimi\swig\Examples\perl5\simple>perl makefile.pl . . . C:\Users\mimi\swig\Examples\perl5\simple>dmake . . . C:\Users\mimi\swig\Examples\perl5\simple>dmake install . . . C:\Users\mimi\swig\Examples\perl5\simple>perl runme.pl The gcd of 42 and 105 is 21 Foo = 3 Foo = 3.1415926

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://899748]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found