Thanks for all the input - it is really appreciated. Anon - that's a really good tip about the new and safefree...I didn't know that. Sadly, it's actually a file pointer that's being passed. I tried it before with the perio functions, but of course the formats are different and changing it back over to a FILE * brings back the runtime conflict again.

I also tried compiling with minGW, but it seems compiler wrangling is not my forte. The libraries have to compile with VS (the perl is just a quick-start helper type thing), and I couldn't seem to get them to work correctly. To be honest, I didn't give this too much of a go because I did read that mingw compiles with msvcrt by default and I was worried I would spend a long time on it only to find that it's like Makemaker itself - theoretically possible to compile with another runtime, but only if you can work the voodoo properly.

Anyway, not the ideal solution, but what I ended up doing was basically working around the problem. Most of our source code for this is supplied in another package and it's required in order to install this one (libraries and code in the same group, perl XS in another). The code actually compiles from a few libraries, and only one does not have the source code supplied. I basically just went into the code, severed the file pointer connection between the source and non-source libraries, grabbed the source directory location from the registry using Win32API::Registry and compiled the source into the XS using the object attribute in the Makefile.PL as

OBJECT => '$(BASEEXT)$(OBJ_EXT) ".$extrafile."$(OBJ_EXT)'

and re-wrote the c_o functions to compile from the source directory.

Granted, it's not ideal, but really nothing about this whole thing is ideal. I can't imagine what you would do if you weren't able to re-compile the libraries at all. I think you'd be pretty screwed. I know microsoft calls both the manifest requirement and the random heap corruption a "feature" or that it "functions as designed", but to me this seems like a design flaw. Maybe I'm wrong - maybe the design is great and this is just a minuscule side effect that happened to hit me, but I can see lots of possible scenarios where this could bite you pretty badly. A lot of these problems could be so easily fixed too, if the manifest requirement was dropped (not even really sure why they are required anyway - the don't say much and they are easy to fake), and the DLL was shipped by default with windows.

Anyways, thanks everyone again - it was much appreciated. Hopefully the info about the new and safefree will help others who stumble onto this thread. I know I'll be keeping it in mind.

In reply to Re: a tale of the windows runtime libs by cfreeman
in thread a tale of the windows runtime libs by cfreeman

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.