[lug] Semi-OT: Perl/Cygwin Question

Zichary O`Tea zirotea at cyberspace.org
Mon Mar 15 16:18:33 MST 2004


Hey, 

I know this isn't exactly linux, but any help would be appreciated.  

I have a perl script that runs all nice and fine on linux, and uses a
perl module made with XS.  A person, who shall remain anonymous, would
really like it if I could make it compile on cygwin so he could run it on
windows XP.  

I seem to be having a problem that frequently crops up with cygwin when
compiling C code.  When the makefile goes to link the C libraries together
(to build the perl module created with XS) I get the error "undefined
reference to WinMain at 16." In the cygwin faq it suggests putting an empty
main() function in one of the sources.  See: 

http://cygwin.com/faq/faq_4.html#SEC95 

However, when I use this library in my perl program and try to instantiate
an object from the library I get a Segmentation Fault (only on cygwin, it
works perfectly on linux). 


Is there any voodoo known to those on this list that will side step the
need to include the main function (which I'm assuming is some how causing
the segmentation fault), or is there anyone her who understands the
linking process better than I do who could suggest.... Something?
ANYTHING?  PLEASE HELP!!!  



Failing that -- when I try to use the perl debugger to see exactly where
the segmentation fault occurs (I'm assuming its because of the bogus main
function, but I try to keep an open mind), when I load the perl script, I
can never get it to give me a debugger prompt, even when I follow the
instructions for "Debugging compile-time statments" here: 

http://www.perldoc.com/perl5.8.0/pod/perldebug.html#Debugging-compile-time-statements
 

Any suggestions about how to get the debugger to work would also be
appreciated.  It will also be good for your karma and increase your
chances as coming back as a rich super-star in your next life. 




More information about the LUG mailing list