Неразрешенный внешний при использовании журнала повышения

У меня возникла проблема при попытке использовать журнал повышения. Я получаю следующее сообщение об ошибке:

1>------ Build started: Project: vms, Configuration: Release x64 ------
1>  main.cpp
1>  Linking to lib file: libboost_system-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_date_time-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_regex-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_log-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_filesystem-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_date_time-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_thread-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_atomic-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_chrono-vc140-mt-1_60.lib
1>  Linking to lib file: libboost_log_setup-vc140-mt-1_60.lib
1>main.obj : error LNK2001: unresolved external symbol "public: static void __cdecl boost::log::v2s_mt_nt5::aux::stream_provider<char>::release_compound(struct boost::log::v2s_mt_nt5::aux::stream_provider<char>::stream_compound *)" (?release_compound@?$stream_provider@D@aux@v2s_mt_nt5@log@boost@@SAXPEAUstream_compound@12345@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: static struct boost::log::v2s_mt_nt5::aux::stream_provider<char>::stream_compound * __cdecl boost::log::v2s_mt_nt5::aux::stream_provider<char>::allocate_compound(class boost::log::v2s_mt_nt5::record &)" (?allocate_compound@?$stream_provider@D@aux@v2s_mt_nt5@log@boost@@SAPEAUstream_compound@12345@AEAVrecord@345@@Z)
1>main.obj : error LNK2001: unresolved external symbol "void __cdecl boost::log::v2s_mt_nt5::aux::attach_attribute_name_info(class boost::exception &,class boost::log::v2s_mt_nt5::attribute_name const &)" (?attach_attribute_name_info@aux@v2s_mt_nt5@log@boost@@YAXAEAVexception@4@AEBVattribute_name@234@@Z)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::aux::id<struct boost::log::v2s_mt_nt5::aux::process> __cdecl boost::log::v2s_mt_nt5::aux::this_process::get_id(void)" (?get_id@this_process@aux@v2s_mt_nt5@log@boost@@YA?AV?$id@Uprocess@aux@v2s_mt_nt5@log@boost@@@2345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "unsigned int __cdecl boost::log::v2s_mt_nt5::aux::unhandled_exception_count(void)" (?unhandled_exception_count@aux@v2s_mt_nt5@log@boost@@YAIXZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::attribute_name __cdecl boost::log::v2s_mt_nt5::aux::default_attribute_names::process_id(void)" (?process_id@default_attribute_names@aux@v2s_mt_nt5@log@boost@@YA?AVattribute_name@345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::attribute_name __cdecl boost::log::v2s_mt_nt5::aux::default_attribute_names::message(void)" (?message@default_attribute_names@aux@v2s_mt_nt5@log@boost@@YA?AVattribute_name@345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::attribute_name __cdecl boost::log::v2s_mt_nt5::aux::default_attribute_names::thread_id(void)" (?thread_id@default_attribute_names@aux@v2s_mt_nt5@log@boost@@YA?AVattribute_name@345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::attribute_name __cdecl boost::log::v2s_mt_nt5::aux::default_attribute_names::timestamp(void)" (?timestamp@default_attribute_names@aux@v2s_mt_nt5@log@boost@@YA?AVattribute_name@345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::attribute_name __cdecl boost::log::v2s_mt_nt5::aux::default_attribute_names::line_id(void)" (?line_id@default_attribute_names@aux@v2s_mt_nt5@log@boost@@YA?AVattribute_name@345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "void __cdecl boost::log::v2s_mt_nt5::aux::code_convert_impl(wchar_t const *,unsigned __int64,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::locale const &)" (?code_convert_impl@aux@v2s_mt_nt5@log@boost@@YAXPEB_W_KAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVlocale@6@@Z)
1>main.obj : error LNK2001: unresolved external symbol "private: void __cdecl boost::log::v2s_mt_nt5::aux::once_block_sentry::rollback(void)" (?rollback@once_block_sentry@aux@v2s_mt_nt5@log@boost@@AEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "private: bool __cdecl boost::log::v2s_mt_nt5::aux::once_block_sentry::enter_once_block(void)const " (?enter_once_block@once_block_sentry@aux@v2s_mt_nt5@log@boost@@AEBA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::aux::once_block_sentry::commit(void)" (?commit@once_block_sentry@aux@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::unlock(void)" (?unlock@light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::lock(void)" (?lock@light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::unlock_shared(void)" (?unlock_shared@light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::lock_shared(void)" (?lock_shared@light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::~light_rw_mutex(void)" (??1light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAA@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::log::v2s_mt_nt5::aux::light_rw_mutex::light_rw_mutex(void)" (??0light_rw_mutex@aux@v2s_mt_nt5@log@boost@@QEAA@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::aux::id<struct boost::log::v2s_mt_nt5::aux::thread> const & __cdecl boost::log::v2s_mt_nt5::aux::this_thread::get_id(void)" (?get_id@this_thread@aux@v2s_mt_nt5@log@boost@@YAAEBV?$id@Uthread@aux@v2s_mt_nt5@log@boost@@@2345@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: class boost::log::v2s_mt_nt5::attribute_value_set::const_iterator __cdecl boost::log::v2s_mt_nt5::attribute_value_set::find(class boost::log::v2s_mt_nt5::attribute_name)const " (?find@attribute_value_set@v2s_mt_nt5@log@boost@@QEBA?AVconst_iterator@1234@Vattribute_name@234@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: class boost::log::v2s_mt_nt5::attribute_value_set::const_iterator __cdecl boost::log::v2s_mt_nt5::attribute_value_set::end(void)const " (?end@attribute_value_set@v2s_mt_nt5@log@boost@@QEBA?AVconst_iterator@1234@XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: void __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::construct(class boost::filesystem::path const &,int,unsigned __int64,class boost::log::v2s_mt_nt5::aux::light_function<bool __cdecl(void)> const &,bool)" (?construct@text_file_backend@sinks@v2s_mt_nt5@log@boost@@AEAAXAEBVpath@filesystem@5@H_KAEBV?$light_function@$$A6A_NXZ@aux@345@_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::flush(void)" (?flush@text_file_backend@sinks@v2s_mt_nt5@log@boost@@QEAAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::consume(class boost::log::v2s_mt_nt5::record_view const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?consume@text_file_backend@sinks@v2s_mt_nt5@log@boost@@QEAAXAEBVrecord_view@345@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: unsigned __int64 __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::scan_for_files(enum boost::log::v2s_mt_nt5::sinks::file::scan_method,bool)" (?scan_for_files@text_file_backend@sinks@v2s_mt_nt5@log@boost@@QEAA_KW4scan_method@file@2345@_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::set_file_collector(class boost::shared_ptr<struct boost::log::v2s_mt_nt5::sinks::file::collector> const &)" (?set_file_collector@text_file_backend@sinks@v2s_mt_nt5@log@boost@@QEAAXAEBV?$shared_ptr@Ucollector@file@sinks@v2s_mt_nt5@log@boost@@@5@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::log::v2s_mt_nt5::sinks::text_file_backend::~text_file_backend(void)" (??1text_file_backend@sinks@v2s_mt_nt5@log@boost@@QEAA@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::log::v2s_mt_nt5::attribute_set::~attribute_set(void)" (??1attribute_set@v2s_mt_nt5@log@boost@@QEAA@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl boost::log::v2s_mt_nt5::attribute_set::attribute_set(void)" (??0attribute_set@v2s_mt_nt5@log@boost@@QEAA@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: static void __cdecl boost::log::v2s_mt_nt5::record_view::public_data::destroy(struct boost::log::v2s_mt_nt5::record_view::public_data const *)" (?destroy@public_data@record_view@v2s_mt_nt5@log@boost@@SAXPEBU12345@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: static void __cdecl boost::log::v2s_mt_nt5::attribute::impl::operator delete(void *,unsigned __int64)" (??3impl@attribute@v2s_mt_nt5@log@boost@@SAXPEAX_K@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: static void * __cdecl boost::log::v2s_mt_nt5::attribute::impl::operator new(unsigned __int64)" (??2impl@attribute@v2s_mt_nt5@log@boost@@SAPEAX_K@Z)
1>main.obj : error LNK2001: unresolved external symbol "private: void __cdecl boost::log::v2s_mt_nt5::core::push_record_move(class boost::log::v2s_mt_nt5::record &)" (?push_record_move@core@v2s_mt_nt5@log@boost@@AEAAXAEAVrecord@234@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: class boost::log::v2s_mt_nt5::record __cdecl boost::log::v2s_mt_nt5::core::open_record(class boost::log::v2s_mt_nt5::attribute_set const &)" (?open_record@core@v2s_mt_nt5@log@boost@@QEAA?AVrecord@234@AEBVattribute_set@234@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: struct std::pair<class boost::log::v2s_mt_nt5::attribute_set::iter<0>,bool> __cdecl boost::log::v2s_mt_nt5::core::add_global_attribute(class boost::log::v2s_mt_nt5::attribute_name const &,class boost::log::v2s_mt_nt5::attribute const &)" (?add_global_attribute@core@v2s_mt_nt5@log@boost@@QEAA?AU?$pair@V?$iter@$0A@@attribute_set@v2s_mt_nt5@log@boost@@_N@std@@AEBVattribute_name@234@AEBVattribute@234@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::log::v2s_mt_nt5::core::add_sink(class boost::shared_ptr<class boost::log::v2s_mt_nt5::sinks::sink> const &)" (?add_sink@core@v2s_mt_nt5@log@boost@@QEAAXAEBV?$shared_ptr@Vsink@sinks@v2s_mt_nt5@log@boost@@@4@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: bool __cdecl boost::log::v2s_mt_nt5::core::get_logging_enabled(void)const " (?get_logging_enabled@core@v2s_mt_nt5@log@boost@@QEBA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: static class boost::shared_ptr<class boost::log::v2s_mt_nt5::core> __cdecl boost::log::v2s_mt_nt5::core::get(void)" (?get@core@v2s_mt_nt5@log@boost@@SA?AV?$shared_ptr@Vcore@v2s_mt_nt5@log@boost@@@4@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::log::v2s_mt_nt5::basic_formatter<char> __cdecl boost::log::v2s_mt_nt5::parse_formatter<char>(char const *,char const *)" (??$parse_formatter@D@v2s_mt_nt5@log@boost@@YA?AV?$basic_formatter@D@012@PEBD0@Z)
1>a.exe : fatal error LNK1120: 41 unresolved externals
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Я не совсем уверен, что не так. Библиотеки есть, компоновщик их находит. Только не символы в них. Какие-нибудь советы?


person graywolf    schedule 12.01.2016    source источник
comment
сокровищница: stackoverflow.com/   -  person sehe    schedule 12.01.2016
comment
Что ж, неразрешенный внешний символ — это признак того, что компоновщик не их нашел. Что заставляет вас думать, что он их находит?   -  person Algirdas Preidžius    schedule 12.01.2016
comment
Если вы выполняете динамическую компоновку, не забудьте определить макрос BOOST_ALL_DYN_LINK.   -  person Nacho    schedule 12.01.2016
comment
Посмотрите на этот вопрос: проблемы-связывание -boost-log-1-60 Флаги и проблемы с настройкой WRT при подключении к boost-log в Windows.   -  person kenba    schedule 12.01.2016


Ответы (2)


Ок, разобрался. Проблема была в том, что boost был скомпилирован с _WIN32_WINNT 0x0601, а я собирал с 0x0501. Только что изменил мой на 0x0601, и он отлично соединился.

person graywolf    schedule 12.01.2016
comment
У меня была такая же проблема, но я не мог изменить _WIN32_WINNT. Мое решение состояло в том, чтобы дать Боосу правильную версию, используя следующие определения: -D_WIN32_WINNT=0x0501 -DBOOST_USE_WINAPI_VERSION=0x0501 - person DaJunkie; 31.03.2017

Но эта созданная вами программа или приложение работает в Windows 7 и выше. Он не поддерживает Windows XP.

Если вы хотите создать приложение, поддерживающее Windows XP, вы можете использовать версию BOOST 1.58. Эта версия является последней, которая поддерживает Windows XP. Затем более поздние версии поддерживают больше, чем Windows XP (т.е.) только из Vista.

person Arun kumar Kalaiarasan    schedule 29.03.2016
comment
Это неправда. Boost выпускает до версии 1.60 по умолчанию для Windows XP. В версии 1.60 значение по умолчанию изменилось на Vista/Server 2008, но вы по-прежнему можете собрать Boost для Windows XP. См. здесь: boost.org/users/history/version_1_60_0.html - person Andrey Semashev; 29.03.2016
comment
Хорошо, мистер Андрей. Еще раз, спасибо. - person Arun kumar Kalaiarasan; 29.03.2016