Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

c++ - Boost-log linker error

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...