简体   繁体   English

提升LNK2019错误

[英]boost LNK2019 error

I read through the boost documentation using the '5.3.4 Invoke b2' and followed up with forum threads that explained details of linking the boost library to the header and linker directories , in the boost help '4.1 Build From the Visual Studio IDE', and found this cool boost related wiki that explained the bjam.exe controls . 我使用“ 5.3.4 Invoke b2”通读了boost文档 ,并在论坛线程中进行了后续讨论,这些线程在boost帮助“ 4.1从Visual Studio IDE进行构建”中解释了将boost库链接标头和链接器目录的详细信息,并找到了这个有趣的 Boost相关Wiki,它解释了bjam.exe控件

placed #include <boost/thread/thread.hpp> in the main.cpp #include <boost/thread/thread.hpp>放在main.cpp中

And, I get this linker error, and the existing help threads have identified the problem is with x64: 而且,我收到此链接器错误,并且现有的帮助线程已确定问题出在x64:

The error: 错误:

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

they are similar, something about 'posix_category' and something about 'native_ecat' 它们相似,关于'posix_category''native_ecat'

So, I tried to build the x64 boost library, and found conflicting instructions on where to put these: 因此,我尝试构建x64 boost库,并发现将这些放置在何处有冲突的说明:

Also, I tried changing the vs2008 configuration back to x32 -> solutionExplorer/solution_properties/configuration_manager/active_solution_platform - Win32, closed and reopened visual studio - relinked the additional directories C/C++/general and Linker/general to Boost/root and Boost/stage/lib - and it compiled without error. 此外,我尝试将vs2008配置更改回x32-> solutionExplorer / solution_properties / configuration_manager / active_solution_platform-Win32,关闭并重新打开了Visual Studio-将其他目录C / C ++ / general和Linker / general重新链接到Boost / root和Boost / stage / lib-并且它编译没有错误。

My best guess at the b2 commands is --toolset=msvc-9.0 address-model=64 --build-type=complete --stagedir=lib\\x64 stage 我对b2命令的最佳猜测是--toolset=msvc-9.0 address-model=64 --build-type=complete --stagedir=lib\\x64 stage

Please give concise instructions for how to build and install x64 version of boost on VS2008. 请简要说明如何在VS2008上构建和安装x64版本的boost。 Also, what was the wiki talking about for release and debug - they are not in Boost invocation ? 另外,维基在谈论发布和调试-它们不在Boost调用中吗?

use c++ 11 使用C ++ 11

It more or less includes all the features of boost I wanted to use, also compiles in g++ without figuring out how to build the boost library on my university server and then reference into a remote g++ build - pretty much solved everything with that 它或多或少包含了我要使用的boost的所有功能,还可以在g ++中进行编译,而无需弄清楚如何在大学服务器上构建boost库,然后引用到远程g ++构建中-几乎解决了所有问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM