curl / Mailing Lists / curl-library / Single Mail


Re: Can't build Windows static x64

From: Ray Satiro via curl-library <>
Date: Wed, 10 Jan 2018 16:43:27 -0500

On 1/10/2018 5:51 AM, William Zeitler wrote:
> I need to build Windows static x64.
> Using curl-757.0.tar.gz, in ...\winbuild I enter
>     nmake /f mode=static MACHINE=x64
> The build fails with:
> ..\builds\libcurl-vc-x64-release-static-ipv6-sspi-winssl-obj-lib/file.obj
> : fatal error LNK1112: module machine type 'x86' conflicts with target
> machine type 'x64'
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\link.exe"'
> : return code '0x458'
> Stop.

It looks like you are using the wrong environment. If you want to build
for x64 you have to use the x64 environment and if you want to build for
x86 you have to use the x86 environment. The easiest way to do this is
use the Visual Studio command prompt shortcuts which automatically set
up the environment.

If your OS is 64-bit then Visual Studio should have installed the 64-bit
tools. There should be shortcuts in the start menu Visual Studio xxxx >
Visual Studio Tools > and there will be a Command Prompt named Visual
Studio x64 Win64 or Visual Studio x64 Native. Those are the 64-bit
tools. If your OS is 32-bit then it only installed the cross compiler
tools, so the shortcut is something like Visual Studio x64 cross
compiler. IIRC it's faster to use the native tools if they're available.

Received on 2018-01-10