2008-11-19 11 views
44

Ich habe die x86 Boost-Bibliotheken viele Male gebaut, aber ich kann nicht scheinen, x64 Bibliotheken zu bauen. Ich starte das „Visual Studio 2005 x64 Kreuz Tools-Eingabeaufforderung“ und betreiben meine übliche Build:Wie erstellen Sie die x64 Boost-Bibliotheken unter Windows?

bjam --toolset=msvc --build-type=complete --build-dir=c:\build install 

Aber es produziert noch x86 LIB-Dateien (ich überprüfte diese mit dumpbin/Header). Was mache ich falsch?

Antwort

57

Sie müssen den Parameter address-model=64 hinzufügen.

Schauen Sie z.B. here.

+2

Diese Antwort ist für das neuere Boost Build-Tool auch gültig, 'b2'. – anderas

+2

kannst du das dann erklären? C: \ Boost \ boost_1_61_0>. \ B2 --stagedir = lib \ x64 architektur = x86 adresse-modell = 64 link = statisch --build-type = komplette stufe Konfigurationsprüfungen durchführen - 32-bit: ja – stu

2

Die akzeptierte Antwort richtig ist. Hinzufügen für den Fall, dass jemand anders diese Antwort googelt und immer noch keine x64-Version produziert.

Folgendes musste ich tun, um Boost 1.63 auf VS 15 2017 Community Edition zu bauen.

Befehle ausgeführt von VS-Umgebung cmd-Shell. Extras -> Visual Studio Eingabeaufforderung

C:\Work\Boost_1_63> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat amd64 
C:\Work\Boost_1_63> bootstrap.bat C:\Work\Boost_1_63> bjam -j4 architecture=x86 address-model=64 link=static stage 
C:\Work\Boost_1_63> bjam --prefix=C:\opt\boost architecture=x86 address-model=64 link=static install 

Sie können überprüfen, dass die resultierende LIB ist x64 mit dumpbin:

C:\Work> dumpbin /headers C:\work\boost_1_63\stage\lib\libboost_locale-vc140-mt-1_63.lib | findstr machine 
8664 machine (x64) 
8664 machine (x64) 
8664 machine (x64) 
8664 machine (x64) ... 
Verwandte Themen