⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perlwin32.pod

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 POD
📖 第 1 页 / 共 3 页
字号:
If you read this file _as_is_, just ignore the funny characters you
see. It is written in the POD format (see pod/perlpod.pod) which is
specially designed to be readable as is.

=head1 NAME

perlwin32 - Perl under Windows

=head1 SYNOPSIS

These are instructions for building Perl under Windows 9x/NT/2000/XP
on the Intel x86 and Itanium architectures.

=head1 DESCRIPTION

Before you start, you should glance through the README file
found in the top-level directory to which the Perl distribution
was extracted.  Make sure you read and understand the terms under
which this software is being distributed.

Also make sure you read L<BUGS AND CAVEATS> below for the
known limitations of this port.

The INSTALL file in the perl top-level has much information that is
only relevant to people building Perl on Unix-like systems.  In
particular, you can safely ignore any information that talks about
"Configure".

You may also want to look at two other options for building
a perl that will work on Windows NT:  the README.cygwin and
README.os2 files, each of which give a different set of rules to
build a Perl that will work on Win32 platforms.  Those two methods
will probably enable you to build a more Unix-compatible perl, but
you will also need to download and use various other build-time and
run-time support software described in those files.

This set of instructions is meant to describe a so-called "native"
port of Perl to Win32 platforms.  This includes both 32-bit and
64-bit Windows operating systems.  The resulting Perl requires no
additional software to run (other than what came with your operating
system).  Currently, this port is capable of using one of the
following compilers on the Intel x86 architecture:

      Borland C++           version 5.02 or later
      Microsoft Visual C++  version 2.0 or later
      MinGW with gcc        gcc version 2.95.2 or later

The last of these is a high quality freeware compiler.  Use version
3.2.x or later for the best results with this compiler.

The Borland C++ and Microsoft Visual C++ compilers are also now being given
away free.  The Borland compiler is available as "Borland C++ Compiler Free
Command Line Tools" and is the same compiler that ships with the full
"Borland C++ Builder" product.  The Microsoft compiler is available as
"Visual C++ Toolkit 2003" or "Visual C++ 2005/2008 Express Edition" (and also
as part of the ".NET Framework SDK") and is the same compiler that ships with
"Visual C++ .NET 2003 Professional" or "Visual C++ 2005/2008 Professional"
respectively.

This port can also be built on the Intel IA64 using:

      Microsoft Platform SDK	Nov 2001 (64-bit compiler and tools)

The MS Platform SDK can be downloaded from http://www.microsoft.com/.

This port fully supports MakeMaker (the set of modules that
is used to build extensions to perl).  Therefore, you should be
able to build and install most extensions found in the CPAN sites.
See L<Usage Hints for Perl on Win32> below for general hints about this.

=head2 Setting Up Perl on Win32

=over 4

=item Make

You need a "make" program to build the sources.  If you are using
Visual C++ or the Platform SDK tools under Windows NT/2000/XP, nmake
will work.  All other builds need dmake.

dmake is a freely available make that has very nice macro features
and parallelability.

A port of dmake for Windows is available from:

    http://search.cpan.org/dist/dmake/

Fetch and install dmake somewhere on your path.

There exists a minor coexistence problem with dmake and Borland C++
compilers.  Namely, if a distribution has C files named with mixed
case letters, they will be compiled into appropriate .obj-files named
with all lowercase letters, and every time dmake is invoked
to bring files up to date, it will try to recompile such files again.
For example, Tk distribution has a lot of such files, resulting in
needless recompiles every time dmake is invoked.  To avoid this, you
may use the script "sync_ext.pl" after a successful build.  It is
available in the win32 subdirectory of the Perl source distribution.

=item Command Shell

Use the default "cmd" shell that comes with NT.  Some versions of the
popular 4DOS/NT shell have incompatibilities that may cause you trouble.
If the build fails under that shell, try building again with the cmd
shell.

The nmake Makefile also has known incompatibilities with the
"command.com" shell that comes with Windows 9x.  You will need to
use dmake and makefile.mk to build under Windows 9x.

The surest way to build it is on Windows NT/2000/XP, using the cmd shell.

Make sure the path to the build directory does not contain spaces.  The
build usually works in this circumstance, but some tests will fail.

=item Borland C++

If you are using the Borland compiler, you will need dmake.
(The make that Borland supplies is seriously crippled and will not
work for MakeMaker builds.)

See L</"Make"> above.

=item Microsoft Visual C++

The nmake that comes with Visual C++ will suffice for building.
You will need to run the VCVARS32.BAT file, usually found somewhere
like C:\MSDEV4.2\BIN or C:\Program Files\Microsoft Visual Studio\VC98\Bin.
This will set your build environment.

You can also use dmake to build using Visual C++; provided, however,
you set OSRELEASE to "microsft" (or whatever the directory name
under which the Visual C dmake configuration lives) in your environment
and edit win32/config.vc to change "make=nmake" into "make=dmake".  The
latter step is only essential if you want to use dmake as your default
make for building extensions using MakeMaker.

=item Microsoft Visual C++ 2008 Express Edition Beta 2

This free version of Visual C++ 2008 Professional contains the same compiler
and linker that ship with the full version, and also contains everything
necessary to build Perl, rather than requiring a separate download of the
Platform SDK like previous versions did.

The Beta 2 package is currently available from 

http://msdn2.microsoft.com/en-us/express/future/default.aspx
http://msdn2.microsoft.com/en-gb/express/future/default.aspx

The final release version will probably be found by searching in the Download
Center at http://www.microsoft.com/downloads/search.aspx?displaylang=en in due
course.

Install Visual C++ 2008, then setup your environment using

	C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat

(assuming the default installation location was chosen).

Perl should now build using the win32/Makefile.  You will need to edit that
file to set

	CCTYPE = MSVC90FREE

first.

=item Microsoft Visual C++ 2005 Express Edition

This free version of Visual C++ 2005 Professional contains the same compiler
and linker that ship with the full version, but doesn't contain everything
necessary to build Perl.

You will also need to download the "Platform SDK" (the "Core SDK" and "MDAC
SDK" components are required) for more header files and libraries.

These packages can both be downloaded by searching in the Download Center at
http://www.microsoft.com/downloads/search.aspx?displaylang=en.  (Providing exact
links to these packages has proven a pointless task because the links keep on
changing so often.)

Try to obtain the latest version of the Platform SDK.  Sometimes these packages
contain a particular Windows OS version in their name, but actually work on
other OS versions too.  For example, the "Windows Server 2003 R2 Platform SDK"
also runs on Windows XP SP2 and Windows 2000.

According to the download pages these packages are only supported on Windows
2000/XP/2003, so trying to use these tools on Windows 95/98/ME and even Windows
NT probably won't work.

Install Visual C++ 2005 first, then the Platform SDK.  Setup your environment
as follows (assuming default installation locations were chosen):

	SET PlatformSDKDir=C:\Program Files\Microsoft Platform SDK

	SET PATH=%SystemRoot%\system32;%SystemRoot%;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PlatformSDKDir%\Bin

	SET INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;%PlatformSDKDir%\include

	SET LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%PlatformSDKDir%\lib

	SET LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

(The PlatformSDKDir might need to be set differently depending on which version
you are using. Earlier versions installed into "C:\Program Files\Microsoft SDK",
while the latest versions install into version-specific locations such as
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2".)

Perl should now build using the win32/Makefile.  You will need to edit that
file to set

	CCTYPE = MSVC80FREE

and to set CCHOME, CCINCDIR and CCLIBDIR as per the environment setup above.

=item Microsoft Visual C++ Toolkit 2003

This free toolkit contains the same compiler and linker that ship with
Visual C++ .NET 2003 Professional, but doesn't contain everything
necessary to build Perl.

You will also need to download the "Platform SDK" (the "Core SDK" and "MDAC
SDK" components are required) for header files, libraries and rc.exe, and
".NET Framework SDK" for more libraries and nmake.exe.  Note that the latter
(which also includes the free compiler and linker) requires the ".NET
Framework Redistributable" to be installed first.  This can be downloaded and
installed separately, but is included in the "Visual C++ Toolkit 2003" anyway.

These packages can all be downloaded by searching in the Download Center at
http://www.microsoft.com/downloads/search.aspx?displaylang=en.  (Providing exact
links to these packages has proven a pointless task because the links keep on
changing so often.)

Try to obtain the latest version of the Platform SDK.  Sometimes these packages
contain a particular Windows OS version in their name, but actually work on
other OS versions too.  For example, the "Windows Server 2003 R2 Platform SDK"
also runs on Windows XP SP2 and Windows 2000.

According to the download pages these packages are only supported on Windows
2000/XP/2003, so trying to use these tools on Windows 95/98/ME and even Windows
NT probably won't work.

Install the Toolkit first, then the Platform SDK, then the .NET Framework SDK.
Setup your environment as follows (assuming default installation locations
were chosen):

	SET PlatformSDKDir=C:\Program Files\Microsoft Platform SDK

	SET PATH=%SystemRoot%\system32;%SystemRoot%;C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PlatformSDKDir%\Bin;C:\Program Files\Microsoft.NET\SDK\v1.1\Bin

	SET INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;%PlatformSDKDir%\include;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include

	SET LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;%PlatformSDKDir%\lib;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

(The PlatformSDKDir might need to be set differently depending on which version
you are using. Earlier versions installed into "C:\Program Files\Microsoft SDK",
while the latest versions install into version-specific locations such as
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2".)

Several required files will still be missing:

=over 4

=item *

cvtres.exe is required by link.exe when using a .res file.  It is actually
installed by the .NET Framework SDK, but into a location such as the
following:

	C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

Copy it from there to %PlatformSDKDir%\Bin

=item *

lib.exe is normally used to build libraries, but link.exe with the /lib
option also works, so change win32/config.vc to use it instead:

Change the line reading:

	ar='lib'

to:

	ar='link /lib'

It may also be useful to create a batch file called lib.bat in
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin containing:

	@echo off
	link /lib %*

for the benefit of any naughty C extension modules that you might want to build
later which explicitly reference "lib" rather than taking their value from
$Config{ar}.

=item *

setargv.obj is required to build perlglob.exe (and perl.exe if the USE_SETARGV
option is enabled).  The Platform SDK supplies this object file in source form
in %PlatformSDKDir%\src\crt.  Copy setargv.c, cruntime.h and
internal.h from there to some temporary location and build setargv.obj using

	cl.exe /c /I. /D_CRTBLD setargv.c

Then copy setargv.obj to %PlatformSDKDir%\lib

Alternatively, if you don't need perlglob.exe and don't need to enable the
USE_SETARGV option then you can safely just remove all mention of $(GLOBEXE)
from win32/Makefile and setargv.obj won't be required anyway.

=back

Perl should now build using the win32/Makefile.  You will need to edit that
file to set

	CCTYPE = MSVC70FREE

and to set CCHOME, CCINCDIR and CCLIBDIR as per the environment setup above.

=item Microsoft Platform SDK 64-bit Compiler

The nmake that comes with the Platform SDK will suffice for building
Perl.  Make sure you are building within one of the "Build Environment"
shells available after you install the Platform SDK from the Start Menu.

=item MinGW release 3 with gcc

The latest release of MinGW at the time of writing is 3.1.0, which contains
gcc-3.2.3.  It can be downloaded here:

    http://www.mingw.org/

Perl also compiles with earlier releases of gcc (2.95.2 and up).  See below
for notes about using earlier versions of MinGW/gcc.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -