Aha, that explains the general problem, many thanks. I think I had a .a file lying around earlier, not thinking it mattered, and that's probably the reason that it worked once at random.

What I really want to do is to work with a third-party DLL for which I have a dll.h header file and an Exports.def file. I don't have a static version.

If there's a way to turn this information into a static simplelib.a, then I'm happy to do it. But I can't recompile the third-party DLL. I tried doing what it says at the bottom of https://cygwin.com/cygwin-ug-net/dll.html (dlltool), getting a libsimple.a. I can link standalone.o against this, and even run it, but I get zero output, so something is wrong.

Please excuse the basic questions (remember, g++ and Cygwin on Windows):

How exactly do I turn simplelib.dll into a proper libsimple.a?

How do I link against it stand-alone? I assume ... standalone.o -o standalone -L. -lsimple

How do I tie libsimple.a and glue.o (the XS .o) together into a proper DLL that is self-contained and can be moved around and loaded by DynaLoader?

I'm not against MakeMaker, but I couldn't get it to do what I wanted, and it's so big and intransparent that I decided to try to understand the actual steps first.


In reply to Re^2: XS with DLL by soren.hein
in thread XS with DLL by soren.hein

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.