Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
My perl is ActiveState 5.8.7 build 813.
I do not encounter any issues running this code on an older version of Visual Studio C++. This problem only happens with the newer (free) enviroment ( as in there is no such thing as free beer I suspect ).
I downloaded and installed the free Visual C++ tools at: http://lab.msdn.microsoft.com/express/visualc/ and the new Platform SDK (which you need).
Then, I did a quick and dirty test.

1. h2xs -A -n myModule
2. perl Makefile.pl 3. edit myModule.xs
#include "EXTERN.h" #include "perl.h" #include "XSUB.h" int test ( int a ) { return a; } MODULE = myModule PACKAGE = myModule int test( int a )
4. nmake
(I only got 1 warning about -Gf being deprecated, so I looked up the error and changed the flag to -GF and it compiles with out error. All good so far. )
5. nmake install
6. open up the editor and write a quick script where I call the brain-dead function.
use strict; use myModule; my $var = myModule::test(123); print $var;
7. When I run the script I get a VC++ runtime error:
C:\Perl\bin\perl.exe R6034 An application has made an attempt to load the C runtime library + incorrectly.
And perl dies complaining:
Can't load 'C:/Perl/site/lib/auto/myModule/myModule.dll' for module my +Module: load_file:A dynamic link library (DLL) initialization routine failed at C:/Perl/lib/XSLoa +der.pm line 68. at C:/Perl/site/lib/myModule.pm line 31 Compilation failed in require at c:\progs\ptest.pl line 1. BEGIN failed--compilation aborted at c:\progs\ptest.pl line 1.

Question 1: Does anyone know what is broken and how to fix it?

Question 2: I can see that the -Gf flag needs to be fixed, how to I make the change so that when I use h2xs in the future that that flag is fixed?
Thanks!
JamesNC
Update and solution:
The solution is to create an XML file called perl.exe.manifest and place it in the same directory as your perl.exe and put the following contents in that file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1. +0"> <assemblyIdentity version="0.0.0.0" processorArchitecture="X86" name=" +Perl" type="win32" /> <description>Perl</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version +="8.0.50215.4631" processorArchitecture="x86" publicKeyToken="1fc8b3b +9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
Thanks to everyone who helped. Especially ++Pod Master.
JamesNC

In reply to Problems with FREE MS VC++ tools by JamesNC

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-16 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found