Hi,

This is actually an issue wrt my 64-bit PDL binaries when they get installed on Strawberry Perl.
The distributed auto/PDL/Minuit/Minuit.dll and auto/PDL/Slatec/Slatec.dll need to load the libgcc_s_sjlj-1.dll from the gcc-4.7.0 compiler that I used to build both perl and PDL - and a copy of that libgcc_s_sjlj-1.dll therefore sits alongside those 2 dll's in the distributed package. Instead, however, they use Strawberry's libgcc_s_sjlj-1.dll (which was already loaded by Strawberry Perl itself and is from the gcc-4.4.7 compiler), resulting in an "unfound entry point" error.

So ... is there some trick I can use to force Minuit.dll and Slatec.dll to load the libgcc_s_sjlj-1.dll that sits next to them, instead of using the libgcc_s_sjlj-1.dll that Strawberry perl has already loaded ?
(Note that, on Windows, if libgcc_s_sjlj-1.dll had not already been loaded, then Minuit.dll and Slatec.dll would automatically load the desired libgcc_s_sjlj-1.dll, irrespective of any path settings.)

I wondered initially about the possibility of using Win32::FreeLibrary() to unload the Strawberry dll, followed by a Win32::LoadLibrary() call that specifically loads the libgcc_s_sjlj-1.dll that's needed.
But then, that would mean that Strawberry Perl itself would then be accessing the wrong libgcc_s_sjlj-1.dll, wouldn't it ?
And I wonder whether unloading such a crucial dll would be possible in the first place - even if I did manage to find the handle to it that Win32::FreeLibrary needs.

One simple solution is to replace the libgcc_s_sjlj-1.dll that Strawberry Perl loads (namely, its perl/bin/libgcc_s_sjlj-1.dll) with the libgcc_s_sjlj-1.dll that I'm distributing.
And that seems to work ... but at what risks ?

Another obvious solution is for me to use the same compiler as Strawberry Perl uses - but there's a fair degree of inconvenience associated with that solution, and I would rather not do it if an alternative exists. (In fact, I probably *won't* do it, even if it *is* the only proper solution :-)

Cheers,
Rob

In reply to [OT][Win32] How to load the right dll 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.