boost log 使用碰到的问题.
2011年12月30日
好不容易编译通过了Boost库和Log库,使用时却发现报如下错误:
1>------ Build started: Project: log, Configuration: Debug Win32 ------
1> stdafx.cpp
1> log.cpp
1>c:\program files\microsoft visual studio 10.0\vc\include\boost\log\sources\global_logger_st orage.hpp(136): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf'
1> c:\program files\microsoft visual studio 10.0\vc\include\boost\log\sources\global_logger_st orage.hpp(122) : while compiling class template member function 'void boost::log_mt_nt5::sources::aux::logger_singleton::init_instance(void)'
1> with
1> [
1> TagT=boost::log_mt_nt5::trivial::logger
1> ]
1> c:\program files\microsoft visual studio 10.0\vc\include\boost\log\trivial.hpp(100) : see reference to class template instantiation 'boost::log_mt_nt5::sources::aux::logger_singleton' being compiled
1> with
1> [
1> TagT=boost::log_mt_nt5::trivial::logger
1> ]
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "public: class boost::filesystem3::path & __thiscall boost::filesystem3::path::replace_extension(class boost::filesystem3::path const &)" () referenced in function "class boost::filesystem3::path __cdecl boost::log_mt_nt5::trivial::aux::`anonymous namespace'::suggest_file_name(void)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "private: static class std::codecvt const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(vo id)" () referenced in function "public: static class std::codecvt const & __cdecl boost::filesystem3::path::codecvt(void)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(text_file_backe nd.obj) : error LNK2001: unresolved external symbol "private: static class std::codecvt const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(vo id)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::filesy
2011年12月30日
好不容易编译通过了Boost库和Log库,使用时却发现报如下错误:
1>------ Build started: Project: log, Configuration: Debug Win32 ------
1> stdafx.cpp
1> log.cpp
1>c:\program files\microsoft visual studio 10.0\vc\include\boost\log\sources\global_logger_st orage.hpp(136): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf'
1> c:\program files\microsoft visual studio 10.0\vc\include\boost\log\sources\global_logger_st orage.hpp(122) : while compiling class template member function 'void boost::log_mt_nt5::sources::aux::logger_singleton::init_instance(void)'
1> with
1> [
1> TagT=boost::log_mt_nt5::trivial::logger
1> ]
1> c:\program files\microsoft visual studio 10.0\vc\include\boost\log\trivial.hpp(100) : see reference to class template instantiation 'boost::log_mt_nt5::sources::aux::logger_singleton' being compiled
1> with
1> [
1> TagT=boost::log_mt_nt5::trivial::logger
1> ]
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "public: class boost::filesystem3::path & __thiscall boost::filesystem3::path::replace_extension(class boost::filesystem3::path const &)" () referenced in function "class boost::filesystem3::path __cdecl boost::log_mt_nt5::trivial::aux::`anonymous namespace'::suggest_file_name(void)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "private: static class std::codecvt const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(vo id)" () referenced in function "public: static class std::codecvt const & __cdecl boost::filesystem3::path::codecvt(void)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(text_file_backe nd.obj) : error LNK2001: unresolved external symbol "private: static class std::codecvt const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(vo id)" ()
1>libboost_log-vc100-mt-gd-1_47.lib(trivial.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::filesy

在使用 Boost Log 库时遇到编译警告 C4996 和多个未解析外部符号错误,这些问题与 Boost 文件系统和系统错误类别相关。解决方法可能涉及更新 Boost 库版本、检查链接器设置或确保所有必要的 Boost 库被正确链接。
最低0.47元/天 解锁文章
2126

被折叠的 条评论
为什么被折叠?



