2013-03-06 131 views
1

我通过使用'5.3.4 Invoke b2'阅读了boost documentation,然后在论坛主题中解释了将boost库链接到header and linker directories的详细信息,在助推帮助“4.1从Visual Studio IDE构建',并发现这个很酷的助推器相关wiki,解释bjam.exe controlsboost 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库,发现就在哪里把这些矛盾的指示:

另外,我试图改变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

+0

您使用安装说明中的5.3而不是“5.2简化构建源代码”的任何原因? – us2012 2013-03-06 20:37:41

+0

@ us2012没什么特别的 - 我看到了,但不知道它是什么,它以“5.1安装Visual Studio Binaries”开头,并讨论了不再生产安装的“BoostPro Computing”,所以我可能跳过它并去了为什么看起来像最帮助的线程我读了关于bjam.exe - 足够公平... – 2013-03-06 20:55:21

+0

我不是说它会解决你的问题,但由于它是完全自动化和超易用的,我建议你在最少尝试一下。 – us2012 2013-03-06 20:56:36

回答

-3

使用C++ 11

它或多或少包括增强的所有功能,我想用,也汇集在G ++没有搞清楚如何构建我的大学服务器上的升压库,然后引用到远程G ++构建 - 几乎可以解决所有问题

+0

C++ 11标准库不是完全替代Boost。此外,大多数Boost库都只有头文件,并且不需要你预先编译任何东西,那些不太依赖于其他库的人,所以你可以复制他们的源代码并用适当的编译方式编译它们工具,请参阅https://github.com/filmor/webos-pdf。 – filmor 2013-03-22 11:43:06

+0

我正在使用boost :: thread,并且在两天后无法弄清楚如何在g ++构建中获得库 - 即使我做了6.4版的RedHat-C++ 11也有bug。我对同样情况下的任何其他人的建议是使用C++ 11.此外,你的链接不会涉及任何内容。 – 2013-03-22 16:31:08

+0

您能否详细说明红帽中的错误?此外,这个问题显然是关于Windows的,所以这是一个完全不同的情况。我给出的链接转到我的一个项目中,在该项目中集成了Boost.Thread库,可以添加4个源文件(请参阅https://github.com/filmor/webos-pdf/tree/master/boost_thread )。 – filmor 2013-04-02 10:45:46