麻烦Visial 2010工作室连接升压libaries [英] Trouble linking boost libaries in Visial Studio 2010

查看:126
本文介绍了麻烦Visial 2010工作室连接升压libaries的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据指南编写我的提振libaries发现这里 ,并试图用提高文件系统libary。

I compiled my boost libaries according to the guide found here and tried to use the boost filesystem libary.

当我加入的#include<升压\\文件系统\\ operations.hpp> 我收到以下错误:

When I add #include <boost\filesystem\operations.hpp> I get the following errors:

error LNK2028: unresolved token (0A00009A) "class boost::system::error_code __clrcall boost::filesystem2::detail::dir_itr_close(void * &)" (?dir_itr_close@detail@filesystem2@boost@@$$FYM?AVerror_code@system@3@AAPAX@Z) referenced in function "public: __clrcall boost::filesystem2::detail::dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >::~dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >(void)" (??1?$dir_itr_imp@V?$basic_path@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Upath_traits@filesystem2@boost@@@filesystem2@boost@@@detail@filesystem2@boost@@$$FQAM@XZ)
error LNK2028: unresolved token (0A0000A2) "class boost::system::error_category const & __clrcall boost::system::generic_category(void)" (?generic_category@system@boost@@$$FYMABVerror_category@12@XZ) referenced in function "void __clrcall `anonymous namespace'::`dynamic initializer for 'void __clrcall boost::system::posix_category::A0x6367c629(void)''(void)" (???__E?A0x6367c629@posix_category@system@boost@@YMXXZ@?A0x6367c629@@$$FYMXXZ)
error LNK2028: unresolved token (0A0000A3) "class boost::system::error_category const & __clrcall boost::system::system_category(void)" (?system_category@system@boost@@$$FYMABVerror_category@12@XZ) referenced in function "void __clrcall `anonymous namespace'::`dynamic initializer for 'void __clrcall boost::system::native_ecat::A0x6367c629(void)''(void)" (???__E?A0x6367c629@native_ecat@system@boost@@YMXXZ@?A0x6367c629@@$$FYMXXZ)
error LNK2019: unresolved external symbol "class boost::system::error_code __clrcall boost::filesystem2::detail::dir_itr_close(void * &)" (?dir_itr_close@detail@filesystem2@boost@@$$FYM?AVerror_code@system@3@AAPAX@Z) referenced in function "public: __clrcall boost::filesystem2::detail::dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >::~dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >(void)" (??1?$dir_itr_imp@V?$basic_path@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Upath_traits@filesystem2@boost@@@filesystem2@boost@@@detail@filesystem2@boost@@$$FQAM@XZ)
error LNK2019: unresolved external symbol "class boost::system::error_category const & __clrcall boost::system::generic_category(void)" (?generic_category@system@boost@@$$FYMABVerror_category@12@XZ) referenced in function "void __clrcall `anonymous namespace'::`dynamic initializer for 'void __clrcall boost::system::posix_category::A0x6367c629(void)''(void)" (???__E?A0x6367c629@posix_category@system@boost@@YMXXZ@?A0x6367c629@@$$FYMXXZ)
error LNK2019: unresolved external symbol "class boost::system::error_category const & __clrcall boost::system::system_category(void)" (?system_category@system@boost@@$$FYMABVerror_category@12@XZ) referenced in function "void __clrcall `anonymous namespace'::`dynamic initializer for 'void __clrcall boost::system::native_ecat::A0x6367c629(void)''(void)" (???__E?A0x6367c629@native_ecat@system@boost@@YMXXZ@?A0x6367c629@@$$FYMXXZ)

如果我没有编译包括operations.hpp它工作正常。问题是,当我使用的#define BOOST_LIB_DIAGNOSTIC 这表明,它在提升libaries正确链接:

If I compile without including operations.hpp it works fine. The thing is that when I use #define BOOST_LIB_DIAGNOSTIC It shows that it is linking in the boost libaries correctly:

Linking to lib file: libboost_filesystem-vc100-mt-gd-1_44.lib
Linking to lib file: libboost_system-vc100-mt-gd-1_44.lib

我会很感激,如果任何人都可以提供建议。

I'd be grateful if anyone could offer advice.

推荐答案

在项目选项(在链接选项组)添加缺少的在库的依赖关系,并添加路径,以提高在其他目录库。或者,启用自动链接(如果你编译提振,因为DLL文件)在C ++选项preprocessor符号定义BOOST_ALL_DYN_LINK,该项目。

In the project options (at linker option group) add the missing libraries at dependencies, and add the path to boost libraries in the additional directories. Or, to enable automatic linking (if you compiled boost as DLLs) define BOOST_ALL_DYN_LINK in the preprocessor symbols in C++ options, in the project.

这篇关于麻烦Visial 2010工作室连接升压libaries的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆