Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Building Perl with the free MSVC tools

by bmann (Priest)
on Apr 19, 2004 at 23:18 UTC ( #346487=note: print w/replies, xml ) Need Help??


in reply to Building Perl with the free MSVC tools

I finished building it earlier this afternoon. The key is that the MS .NET SDK insists on installing some files onto the system drive, even if you change the default installation drive.

It took longer to satisfy nmake than it did to build! I took a few quick notes as I installed. Here's a quick recipe:

  1. Install MSVC free compiler
  2. Install the Platform SDK from: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
  3. Download and install .NET SDK in order to satisfy msvcrt.lib requirement.

    Note: The .NET SDK installs files into two directories: one is user configurable and one isn't. I used "D:\Program Files\Microsoft Visual Studio .NET 2003", but the installer installed "lib" and "inc" into "C:\Program Files\Microsoft Visual Studio .NET 2003"

  4. Edit win32/Makefile - (patch inside the readmore)

    23,24c23,24 < INST_DRV = c: < INST_TOP = $(INST_DRV)\perl --- > INST_DRV = d: > INST_TOP = $(INST_DRV)\perl5.9.1 87c87 < CCTYPE = MSVC60 --- > #CCTYPE = MSVC60 #get rid of vc 6 specific stuff 154,155c154,155 < #CCHOME = f:\msvc20 < CCHOME = $(MSVCDIR) --- > CCHOME = d:\program files\microsoft visual c++ toolki +t 2003 > #CCHOME = $(MSVCDIR) 396c396 < CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOC +DEFS) \ --- > CFLAGS = -nologo -GF -W3 $(INCLUDES) $(DEFINES) $(LOC +DEFS) \ 820c820,821 < perlglob$(o) setargv$(o) --- > perlglob$(o) > #setargv$(o)
  5. Fire up command prompt using Platform SDK shortcut
  6. run vcvars32.bat from compiler installation
  7. set LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib (In order to satisfy msvcrt req.)
  8. path=%PATH%;PATH_TO_SDK\Bin\Win64 (at the END of existing path, required for resource converter)
  9. unpack perl source and cd PATH_TO_UNPACKED_PERL\win32
  10. nmake
  11. nmake test # all tests passed - except skipped tests, of course
  12. nmake install

Fresh, steamin' hot perl 5.9.1, ready to enjoy!

I'll try to replicate the build with bleadperl over the next couple of days and post any fixes or corrections.

Update: corrected LIB path (added Vc7\lib to LIB, see #7 above)

Replies are listed 'Best First'.
Re: Building Perl with the free MSVC tools
by Anonymous Monk on May 23, 2004 at 03:01 UTC
    At http://www.devside.net we have been building Perl 5.8.x for some time now with VS.NET 2002 (that links against msvcr70.lib and uses the msvcr70.dll that comes with .NET 1.0/1.0a)

    We have a guide for building Perl under win32 with VC++...
    (it is a very simple task)

    http://www.devside.net/web/server/windows/perl
    http://www.devside.net/web/server/windows

    Iím not exactly sure what the problem here is, but to clarify a point...

    MSVCRT.dll is the Microsoft C Runtime Library.
    If you use MS VC++, your programs will only link and run with specific versions of this file; managed code or not.
    (the version of MSVCRxx used by the compiler cannot be changed or specified by the user)

    VS98 links only against msvcrt.lib (or maybe even an earlier version)
    VS.NET 2002 links only against msvcr70.lib
    VS.NET 2003 links only against msvcr71.lib

    I would assume that the free MS VC++ 2003 toolkit would only link against MSVCR71.lib

    msvcr70.dll is part of .NET 1.0(a)
    msvcr71.dll is part of .NET 1.1

    Please excuse me if I missed a point, it just seemed to me that there was a difficulty with building Perl under win32 with VC++ above 6.0 in this thread. If someone could clarify, I would be grateful.
      Please excuse me if I missed a point, it just seemed to me that there was a difficulty with building Perl under win32 with VC++ above 6.0 in this thread. If someone could clarify, I would be grateful.
      The point you missed is that none of this was done with any version of Visual Studio, which would make it much simpler.

      MS is offering an undocumented and incomplete toolkit for free. No crt library is included - for that you need to download the .NET SDK. In order to build perl with this freely available compiler there are a couple of other requirements that still need to be met after getting msvcrt.lib. My post details a working method - there may be better solutions.

      Interesting point about msvcrt70(1).dll. Only problem is, just msvcrt.lib (not 70 or 71) is included with the .Net download. Perl's Makefile specifies msvcrt.dll, does that mean it is targeted to VC 6?

        Perl's Makefile specifies msvcrt.dll, does that mean it is targeted to VC 6?

        Checking via Dependency Walker, perl.exe that I built with VS.NET 2002 is using MSVCR70.DLL

        If Perl links against MSVCRT.LIB...

        Searching under my Microsoft Visual Studio .NET directory structure...
        ...the only msvcr(t)xx.lib I can find is "MSVCRT.LIB"; which is under "Microsoft Visual Studio .NET\Vc7\lib"

        I would suppose there are no msvcr70/71.lib files, only the msvcrt.lib file and the dlls.

        Also, the .NET 1.1 SDK on my system does not contain any msvcrt.lib files, just the msvcr71.dll.

        My mistake on the post I made. msvcr70/71.lib is msvcrt.lib, each one specific to the version of VC++ used.
        (is this correct or am I confused?)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://346487]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2018-01-23 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (238 votes). Check out past polls.

    Notices?