Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Free MSVC tools + Activestate to compile CPAN Modules

by strat (Canon)
on Aug 31, 2004 at 06:49 UTC ( #387115=note: print w/ replies, xml ) Need Help??


in reply to Free MSVC tools + Activestate to compile CPAN Modules

If you compile modules, you might need the same version of the compiler perl was compiled (if you use the Activestate-binary, I think you need VisualC6 (which works fine for me). But I don't know if you can download it for free, or at least the build tools)

Well, with the free nmake you can compile a lot of cpan-modules, but for many you need the whole compiler suite (e.g. cl.exe and so on)

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"


Comment on Re: Free MSVC tools + Activestate to compile CPAN Modules
Re^2: Free MSVC tools + Activestate to compile CPAN Modules
by jZed (Prior) on Aug 31, 2004 at 14:14 UTC
    If you compile modules, you might need the same version of the compiler perl was compiled (if you use the Activestate-binary, I think you need VisualC6

    That kind of thinking is what prevented me from trying this in the first place. Do you have any proof that purchasing and using VC6 is any different from using the free VC Toolkit I mention above when compiling using the ActiveState build? (not a rhetorical question, I'd like to know). So far I have not found any modules that don't work with the free version.

    Well, with the free nmake you can compile a lot of cpan-modules

    Strictly speaking, that isn't true. You can *install* non-XS modules with just nmake.exe but you need a compiler to *compile* XS modules. Nmake.exe comes included in the free SDK mentioned above so there is no need to download it separately. But you're right that nmake.exe by itself is useful for installing non-XS modules for those who don't want to or can't download the the full compiler.

      Generally you do need to use the same compiler to build CPAN modules as was used to build Perl.

      Upto version 6 of MSVC++ you can probably get away with using different versions: linking against msvcrt.lib always produced binaries depending on msvcrt.dll, which ships with the OS.

      However, from version 7 onwards (and the free toolkit is version 7) linking against msvcrt.lib now produces binaries depending on msvcr71.dll (or whatever the latest version is).

      ActivePerl is built using MSVC6, so if you build a module using the free tollkit then perl.exe will load msvcrt.dll and the module's DLL will load msvcr71.dll. If any CRT resources (e.g. file descriptors) are passed between the two then you'll have problems.

      I recently discovered this with one of my CPAN modules (Win32-UTCFileTime-1.32). I was able to fix it (in 1.33) by falling back to an OS-level filehandle if the passing of the CRT file descriptor failed. However, another of my modules (Win32-SharedFileOpen) definitely does not work with ActivePerl if built using the free toolkit -- it does much more passing around of CRT resources and can't be fixed as easily. The solution is either to build it with MSVC6, or rebuild Perl using the same compiler as is being used to build the module.

      Microsoft have a brief note about the perils of loading two different CRT DLL's at this URL (at the time of writing!): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp

      - Steve

Re^2: Free MSVC tools + Activestate to compile CPAN Modules
by Ven'Tatsu (Deacon) on Aug 31, 2004 at 16:59 UTC

    This is wrong. For a project I'm working on we compile an XS module using Cygwin's mingw32 compiler, we don't use the MakeMaker Makefile but a hand rolled one, but the generated .dll still loads fine with ActivePerl.

    Admitedly Cygwin is not much help with CPAN modules, as MakeMaker will produce nmake formated Makefiles, but if a mingw32 .dll will link fine then any version of MSVC should work.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://387115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2014-08-31 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls