1

我使用'5.3.4 Invoke b2'通读了boost文档,并跟进了论坛帖子,解释了将boost库链接到头文件和链接器目录的细节,在boost帮助'4.1 Build From the Visual Studio IDE'中,并找到了解释bjam.exe 控件的这个很酷的 boost 相关 wiki 。

放在#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)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ)  main.obj

error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat@system@boost@@YAXXZ)  main.obj

它们是相似的,一些关于'posix_category'和一些关于'native_ecat'

因此,我尝试构建 x64 boost 库,并发现关于将这些放置在何处的说明相互矛盾:

另外,我尝试将 vs2008 配置更改回 x32 -> solutionExplorer/solution_properties/configuration_manager/active_solution_platform - Win32,关闭并重新打开 Visual Studio - 将附加目录 C/C++/general 和 Linker/general 重新链接到 Boost/root 和 Boost/stage /lib - 它编译没有错误。

我对 b2 命令的最佳猜测是--toolset=msvc-9.0 address-model=64 --build-type=complete --stagedir=lib\x64 stage

请简要说明如何在 VS2008 上构建和安装 x64 版本的 boost。另外,wiki 谈论的发布和调试是什么——它们不在Boost 调用中?

4

1 回答 1

-3

使用 C++ 11

它或多或少包含了我想使用的 boost 的所有功能,也可以在 g++ 中编译,而无需弄清楚如何在我的大学服务器上构建 boost 库,然后引用到远程 g++ 构建 - 几乎解决了所有问题

于 2013-03-22T11:03:52.103 回答