develooper Front page | perl.perl5.porters | Postings from August 2011

Re: Error building on windows 7 x64 with nmake

Thread Previous | Thread Next
From:
Tony Cook
Date:
August 13, 2011 19:37
Subject:
Re: Error building on windows 7 x64 with nmake
Message ID:
20110814023700.GA11035@mars.tony.develop-help.com
On Sat, Aug 13, 2011 at 10:26:12PM +0200, register wrote:
> When I try to build from source in Windows 7, x64, visual studio 2010 full,
> perl-5.14.1 I get the following error:
> 
>         link -subsystem:console -out:..\generate_uudmap.exe
> @C:\Users\lucar\AppD
> ata\Local\Temp\nmD6A3.tmp
> ..\generate_uudmap.obj : fatal error LNK1112: module machine type 'X86'
> conflict
> s with target machine type 'x64'
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 10.0
> \VC\BIN\link.EXE"' : return code '0x458'
> 
> 
> Here you can find my win32/Makefile: http://pastebin.com/nxmTYsEG. It's all
> pretty default stuff and only directories, compiler version and debug are
> set.
> 
> Here there is the complete log from nmake: http://pastebin.com/YjjTtaX9.

As others have said you're probably trying to do a 64-bit build with
the 32-bit compiler.

You can check which compiler is visible by running it:

The 32-bit compiler:

C:\Users\tony>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
...

The 64-bit compiler:

C:\Users\tony>cl
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
...

These are from VCE 2008 + Win7 SDK, so the versions will be different.

VCE 2010 includes a script vcvarsall to set the environment for your
build, presumably you can use this on VC 10.0 full to set the compiler
you need:

C:\Users\tony>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat" amd64
The specified configuration type is missing.  The tools for the
configuration might not be installed.

C:\Users\tony>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat" x86
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

(amd64 fails for me, since it's only VC Express.)

So if you want to build a 32-bit perl:

1) uncomment the WIN64=undef in the Makefile

2) if you don't see "32-bit" in the output from "cl" run the x86
vcvarsall command above.

If you want a 64-bit perl:

1) leave WIN64=undef commented

2) run the amd64 vcvarsall command above

Tony

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About