Boost-log链接器错误 [英] Boost-log linker error

查看:728
本文介绍了Boost-log链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从源码下载并构建了Boost 1.55。我试图使用Boost-log。在基本情况下( http: //boost-log.sourceforge.net/libs/log/doc/html)/log/tutorial.html#log.tutorial.trivial 它的工作正常没有任何问题,但是当我尝试使用一些更高级功能(像这样 - http://boost-log.sourceforge。 net / libs / log / example / doc / tutorial_fmt_stream.cpp )我收到此错误:


main.obj :error LNK2019:未解析的外部符号void __cdecl
boost :: filesystem :: path_traits :: convert(char const *,char const
*,class std :: basic_string,class std :: allocator>
&,class std :: codecvt const&)(?convert @ path_traits @ filesystem @ boost @@ YAXPBD0AAV?$ basic_string @ GU?$ char_traits @ G @ std @@ V?$ allocator @ G @ 2 @@ std @@ ABV?$ codecvt @ GDH @ 5 @@ Z)
在函数void __cdecl
引用boost :: filesystem :: path_traits :: dispatch,class std :: allocator>> class
std :: basic_string,class
std :: allocator> const&,class std :: basic_string,class
std :: allocator>&,class std :: codecvt const& ;)
(?? $ dispatch @ V?$ basic_string @ GU?$ char_traits @ G @ std @@ V?$ allocator @ G @ 2 @@ std @@@ path_traits @ filesystem @ boost @@ YAXABV ?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@ AAV?$ basic_string @ GU?$ char_traits @ G @ std @@ V?$ allocator @ G @ 2 @@ 4 @ ABV?$ codecvt @ GDH @ 4 @@ Z)



1> main.obj:error LNK2019:未解析的外部符号void __cdecl
boost :: log :: v2s_mt_nt5 :: aux :: code_convert(unsigned short const
*,unsigned int,class std :: basic_string,class std :: allocator>&,class
std :: locale const&)
(?code_convert @ aux @ v2s_mt_nt5 @ log @ boost @@ YAXPBGIAAV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@ ABVlocale @ 6 @@ Z)
引用函数private:void __thiscall
boost :: log :: v2s_mt_nt5 :: basic_formatting_ostream,class std :: allocator>
:: aligned_write const *,__ int64)(?? $ align_write @ G @?$ basic_formatting_ostream @ DU?$ char_traits @ D @ std @@ V $ $ allocator @ D @ 2 @@ v2s_mt_nt5 @log @ boost @@ AAEXPBG_J @ Z) / p>

1> main.obj:error LNK2019:未解析的外部符号public:static
class std :: codecvt const& __cdecl
boost :: filesystem :: path :: codecvt(void)
(?codecvt @ path @ filesystem @ boost @@ SAABV?$ codecvt @ GDH @ std @@ XZ)
引用在函数public:__thiscall
boost :: filesystem :: path :: path(char const(&)[14],void
*)(?? $?0 $$ BY0O @ $$ CBD @ path @ filesystem @ boost @@ QAE @ AAY0O @ $$ CBDPAX @ Z)


所以基本上不能查找函数convert(...),code_convert(...)和codecvt(...)in .lib文件。



我已经尝试添加所有发布库(.lib文件,同时建立提升)到额外的库,一般我认为visual studio找到所有的库,但不能在库中找到这些功能。任何想法如何可以解决这个问题?



我使用visual studio 2010(msvc10.0),32位,发布和调试从源代码构建Boost 1.55。我在Windows 7 x64上工作。

解决方案

我有同样的问题,我可以通过更改VisualStudio 2010上的一个项目属性来修复它。



转到:



属性页 - > ConfigurationProperties - > C / C ++ - >语言 - >处理WChar_t类型: strong>是(/ Zc:wchar_t)



strong>



我希望它也对您有帮助:)



小心,


i've downloaded and builded Boost 1.55 from source. I'm trying to use Boost-log. In basic case (http://boost-log.sourceforge.net/libs/log/doc/html)/log/tutorial.html#log.tutorial.trivial it's working fine without any problems, but when i try to use some more advanced features(like this - http://boost-log.sourceforge.net/libs/log/example/doc/tutorial_fmt_stream.cpp ) i'm getting this error:

main.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator> &,class std::codecvt const &)" (?convert@path_traits@filesystem@boost@@YAXPBD0AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@ABV?$codecvt@GDH@5@@Z) referenced in function "void __cdecl boost::filesystem::path_traits::dispatch,class std::allocator > >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > &,class std::codecvt const &)" (??$dispatch@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@path_traits@filesystem@boost@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@4@ABV?$codecvt@GDH@4@@Z)

1>main.obj : error LNK2019: unresolved external symbol "void __cdecl boost::log::v2s_mt_nt5::aux::code_convert(unsigned short const *,unsigned int,class std::basic_string,class std::allocator > &,class std::locale const &)" (?code_convert@aux@v2s_mt_nt5@log@boost@@YAXPBGIAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVlocale@6@@Z) referenced in function "private: void __thiscall boost::log::v2s_mt_nt5::basic_formatting_ostream,class std::allocator> ::aligned_write(unsigned short const *,__int64)" (??$aligned_write@G@?$basic_formatting_ostream@DU?$char_traits@D@std@@V?$allocator@D@2@@v2s_mt_nt5@log@boost@@AAEXPBG_J@Z)

1>main.obj : error LNK2019: unresolved external symbol "public: static class std::codecvt const & __cdecl boost::filesystem::path::codecvt(void)" (?codecvt@path@filesystem@boost@@SAABV?$codecvt@GDH@std@@XZ) referenced in function "public: __thiscall boost::filesystem::path::path(char const (&)[14],void *)" (??$?0$$BY0O@$$CBD@path@filesystem@boost@@QAE@AAY0O@$$CBDPAX@Z)

So basically it can't find functions convert(...), code_convert(...) and codecvt(...) in .lib files.

I've already tried to add all release libraries (.lib files made while building boost) to "additional libraries" and generally i think that visual studio find all libraries, but can't find those functions in libraries. Any ideas how can i fix this?

I've build Boost 1.55 from source using visual studio 2010 (msvc10.0), 32 bit, release and debug. I'm working on windows 7 x64.

解决方案

I had the same problem and I could fix it by changing one of the Project properties on VisualStudio 2010.

Go to:

Property Pages -> ConfigurationProperties -> C/C++ -> Language -> Treat WChar_t As Built in Type:

And set the property to:

Yes (/Zc:wchar_t)

I hope it will be helpful for you too :)

Take care,

这篇关于Boost-log链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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