I had taken a look at the ExtUtils::Mksymlists documentation, but didn't look at anything other than the DL_FUNCS docs. A bit further down, one finds FUNCLIST which seems to do exactly as I've asked. (It turns out that FUNCLIST is also documented in the ExtUtils::MakeMaker documentation.) The appropriate Makefile.PL looks like:
use ExtUtils::MakeMaker; my %options = %{ { 'TYPEMAPS' => [ 'C:\\perl510_M\\5.10.0\\lib\\ExtUtils\\typemap' ], 'NAME' => 'Foo', 'INC' => '-IC:/temp/Foo_build', 'FUNCLIST' => ['boot_Foo', 'foo'], 'VERSION' => '0.01' } }; WriteMakefile(%options); # Remove the Makefile dependency. Causes problems on a few systems. sub MY::makefile { '' }
Foo.dll then exports _boot_Foo, _foo, boot_Foo and _foo ... which is exactly what I'm after.

I'm kinda surprised that MinGW et al haven't added an specific extension to deal with this

Actually, __declspec(dllexport) probably works fine. I had made the mistake of coding it as
int __declspec(dllexport) foo(int x, int y)
whereas I think I needed to code it as
__declspec(dllexport) int foo(int x, int y)
Certainly the latter rendition creates a dll that exports foo(). But it exports it as XS_Foo_foo - which is not quite what I want.

Thanks muchly for the excellent help, BrowserUk.

Cheers,
Rob

In reply to Re^6: [XS on Win32] How to have the extension's dll export its symbols. by syphilis
in thread [XS on Win32] How to have the extension's dll export its symbols. by syphilis

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.