LNK2001: My boost libraries are (probably) built incorrectly

筅森魡賤 提交于 2019-12-04 04:06:44
JHBonarius

This seems to be similar as LNK 2019 error using Boost::asio as you have the same errors.

I just installed VS2017RC and boost 1.63. Then I used this description: Build boost with msvc 14.1 ( VS2017 RC) . Note: your line

using msvc : 14.1 : E:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.10.24911\bin\HostX64\x64\;

should probably include the "cl.exe" and quotes.

using msvc : 14.1 : "E:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.10.24911\bin\HostX64\x64\cl.exe";

...They should implement a progress bar or such ;) Guess what:

...failed updating 6 targets...
...skipped 4 targets...
...updated 1214 targets...

So look at the error message:

msvc.compile.asm bin.v2\libs\context\build\msvc-14.1\debug\address-model-64\link-static\threading-multi\asm\make_x86_64_ms_pe_masm.obj
'ml64' is not recognized as an internal or external command, operable program or batch file.
ml64 -nologo -c -Zp4 -Cp -Cx -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_EXPORT= -DBOOST_CONTEXT_SOURCE -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_EXPORT= -DBOOST_CONTEXT_SOURCE /Zi /Zd /W3  -Fo "bin.v2\libs\context\build\msvc-14.1\debug\address-model-64\link-static\threading-multi\asm\make_x86_64_ms_pe_masm.obj" "libs\context\src\asm\make_x86_64_ms_pe_masm.asm"
...failed msvc.compile.asm bin.v2\libs\context\build\msvc-14.1\debug\address-model-64\link-static\threading-multi\asm\make_x86_64_ms_pe_masm.obj...

Missing 64-bit dependencies... So, like KindDragon says in the second link:

Run "Developer Command Prompt for VS 2017 RC" from Windows Start Menu to boostrap from a shell configured using the x86 vcvars or x64 vcvars.

It is necessary to configure the shell using the 64-bit compiler variables.

cd "\Program Files (x86)\Microsoft Visual Studio 14.0\VC"
vcvarsall amd64

..alternatively you could start the x64 native environment from the Start menu: -> Visual Studio 201x -> Visual Studio Tools -> Windows Desktop Command Prompts -> VS201x x64 Native Tools Command Prompt

And then build again.

...failed updating 2 targets...
...skipped 2 targets...
...updated 6 targets...

With error message fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'. So a rebuild is required.

b2 --clean-all
etc...

...You get the point. But it seems I read now in the comments that Bogdan has also mentioned this. Well, Kinddragon in Build boost with msvc 14.1 ( VS2017 RC) was actually first ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!