我通过使用'5.3.4 Invoke b2'阅读了boost documentation,然后在论坛主题中解释了将boost库链接到header and linker directories的详细信息,在助推帮助“4.1从Visual Studio IDE构建',并发现这个很酷的助推器相关wiki,解释bjam.exe controls。boost LNK2019错误
放置#include <boost/thread/thread.hpp>
在main.cpp中
而且,我得到这个连接错误,以及现有的帮助主题已经确定问题是使用x64:
错误:
error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" ([email protected]@[email protected]@[email protected]@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" ([email protected]@[email protected]@YAXXZ) main.obj
error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" ([email protected]@[email protected]@[email protected]@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" ([email protected]@[email protected]@YAXXZ) main.obj
它们是相似的,一些关于'posix_category'
和一些关于'native_ecat'
所以,我试图建立的64 Boost库,发现就在哪里把这些矛盾的指示:
- 没说"Note for x64 users: Add the address-model=64 option to bjam (after the threading argument) in order to build static libs with the 64-bit compiler."
- 不能找到链接,但有人说将x64 lib放在vs2008 bin中?
另外,我试图改变VS2008配置恢复到X32 - > solutionExplorer/solution_properties/configuration_manager/active_solution_platform - Win32中,关闭并重新打开视觉工作室 - 重新链接的其他目录C/C++ /一般和链接器/一般到升压/ root和Boost/stage/lib - 并且编译时没有错误。
我最擅长的是B2命令的猜测是--toolset=msvc-9.0 address-model=64 --build-type=complete --stagedir=lib\x64 stage
请给如何构建和安装增压版本的x64 VS2008上简洁的说明。另外,维基在讨论什么是发布和调试 - 他们不在Boost invocation?
您使用安装说明中的5.3而不是“5.2简化构建源代码”的任何原因? – us2012 2013-03-06 20:37:41
@ us2012没什么特别的 - 我看到了,但不知道它是什么,它以“5.1安装Visual Studio Binaries”开头,并讨论了不再生产安装的“BoostPro Computing”,所以我可能跳过它并去了为什么看起来像最帮助的线程我读了关于bjam.exe - 足够公平... – 2013-03-06 20:55:21
我不是说它会解决你的问题,但由于它是完全自动化和超易用的,我建议你在最少尝试一下。 – us2012 2013-03-06 20:56:36