Boost logo

Boost-Build :

Subject: [Boost-build] Help request from a newbie: unable to build 64 target with Visual 2010
From: Michel Lerenard (michelisotropix_at_[hidden])
Date: 2012-04-19 11:55:24


Hi everyone,

I've been pulling my hair all day because I cannot build the 64 bits
libraries with visual. ( I have no issue building the 32bits targets) I
have the 1.49 package.
I keep getting the following message every time the linker tries to
create a lib.

bin.v2\libs\system\build\msvc-10.0\release\threading-multi\error_code.obj :
fatal error LNK1112: module machine type 'X86' conflicts with target
machine type 'x64'

Naively i thought i forgot to set the flag for the x64 target, as the
link command looked like:
link /NOLOGO /INCREMENTAL:NO /DLL /MACHINE:X86 /subsystem:console /
out:"bin.v2\libs\system\build\msvc-10.0\release\threading-multi\boost_system-vc1
00-mt-1_49.dll"
/IMPLIB:"bin.v2\libs\system\build\msvc-10.0\release\threading-mu
lti\boost_system-vc100-mt-1_49.lib" /MACHINE:x64
@"bin.v2\libs\system\build\ms
vc-10.0\release\threading-multi\boost_system-vc100-mt-1_49.dll.rsp"

Sadly that not enough; running the command

b2 --address-model=64 -j2 link=shared threading=multi variant=release
linkflags="/MACHINE:x64"

i get the error:
link /NOLOGO /INCREMENTAL:NO /DLL /MACHINE:X64 /MACHINE:X86
/subsystem:console /
out:"bin.v2\libs\system\build\msvc-10.0\release\threading-multi\boost_system-vc1
00-mt-1_49.dll"
/IMPLIB:"bin.v2\libs\system\build\msvc-10.0\release\threading-mu
lti\boost_system-vc100-mt-1_49.lib" /MACHINE:x64
@"bin.v2\libs\system\build\ms
vc-10.0\release\threading-multi\boost_system-vc100-mt-1_49.dll.rsp"

As you can see, the fun begins when the linker uses TWO targets flags in
its command. I'm quite lost here, i've tried almost everything: editing
the jam configuration file to take the platform x64 into account (next
to amd64), switching to visual 2008, changing the Visual command line
shortcut to use the "x64" parameter.

Still in the log, i see the line :
call "C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\vcvarsall.bat" x86 >nul.

I guess that one reason why the compiler gets the wrong flag, but how
can i modify this one ?

I'll appreciate every bit of help i can get...


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk