我正在尝试构建一个库并获得几个未解析的外部符号"错误。我试图解决其中一个错误,这些错误应该让我知道如何继续。该错误是:未解析的外部符号IsProcessorFeaturePresent。根据我的理解,因为这不是我试图构建的代码的一部分,所以必须存在于" lib"文件。根据{{3}},lib文件应该是kernel32.lib。现在," Windows Kits"下有几个kernel32.lib文件。在Visual Studio Developer命令提示符中编译时,我认为默认情况下应该包括它,因为它应该是环境的一部分。我仍然添加了一个路径" C:\ Program \ Files \(x86)\ Windows \ Kits \ 8.1 \ Lib \ winv6.3 \ um \ x64"到< library-path>在库的JamFile中的#requirements下,我还添加了"< include> C:\ Program \ Files \(x86)\ Windows \ Kits \ 8.1 \ Include \ um"它。但是错误没有变化。如何找出需要包含哪个文件?
注意:此问题与如何解决未解决的外部符号错误不同,我已经通过了对该问题的回答,现在我正在尝试将其应用于此特定错误。
编辑:我正在尝试构建依赖于Boost.Python的libtorrent库。我在Boost的根目录中使用--with-python = C:\ Python27构建了Boost.Python。之后,我将BOOST_ROOT添加到环境变量中,并将其添加到路径中。之后我尝试使用bjam variant=release memory-model=64
构建libtorrent python绑定。完整的错误日志为this
编辑2:跟进对此问题的评论我已将所需的库添加到JamFile,错误数量已从187减少到11.其余错误为:
create_torrent.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void)" (__imp_?identity_function@objects@python@boost@@YAAEBVobject@api@23@XZ) referenced in function "class boost::python::api::object __cdecl boost::python::objects::detail::demand_iterator_class<struct `anonymous namespace'::FileIter,struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies> >(char const *,struct `anonymous namespace'::FileIter *,struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies> const &)" (??$demand_iterator_class@UFileIter@?A0x1efcf82b@@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@python@boost@@@detail@objects@python@boost@@YA?AVobject@api@23@PEBDPEAUFileIter@?A0x1efcf82b@@AEBU?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@23@@Z)
torrent_info.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void)" (__imp_?identity_function@objects@python@boost@@YAAEBVobject@api@23@XZ)
create_torrent.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::objects::stop_iteration_error(void)" (__imp_?stop_iteration_error@objects@python@boost@@YAXXZ) referenced in function "struct _object * __cdecl boost::python::detail::invoke<struct boost::python::to_python_value<struct libtorrent::file_entry const &>,struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter>::next,struct boost::python::arg_from_python<struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter> &> >(struct boost::python::detail::invoke_tag_<0,0>,struct boost::python::to_python_value<struct libtorrent::file_entry const &> const &,struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter>::next &,struct boost::python::arg_from_python<struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter> &> &)" (??$invoke@U?$to_python_value@AEBUfile_entry@libtorrent@@@python@boost@@Unext@?$iterator_range@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@python@boost@@UFileIter@?A0x1efcf82b@@@objects@23@U?$arg_from_python@AEAU?$iterator_range@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@python@boost@@UFileIter@?A0x1efcf82b@@@objects@python@boost@@@23@@detail@python@boost@@YAPEAU_object@@U?$invoke_tag_@$0A@$0A@@012@AEBU?$to_python_value@AEBUfile_entry@libtorrent@@@12@AEAUnext@?$iterator_range@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@python@boost@@UFileIter@?A0x1efcf82b@@@objects@12@AEAU?$arg_from_python@AEAU?$iterator_range@U?$return_value_policy@Ureturn_by_value@python@boost@@Udefault_call_policies@23@@python@boost@@UFileIter@?A0x1efcf82b@@@objects@python@boost@@@12@@Z)
torrent_info.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::objects::stop_iteration_error(void)" (__imp_?stop_iteration_error@objects@python@boost@@YAXXZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(void)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@XZ) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??0?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@QEAA@XZ)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(void)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@XZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(class boost::python::api::object const &)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@AEBVobject@api@23@@Z) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class boost::python::api::object const &)" (??0?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@QEAA@AEBVobject@api@12@@Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(class boost::python::api::object const &)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@AEBVobject@api@23@@Z)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl boost::python::objects::stl_input_iterator_impl::increment(void)" (__imp_?increment@stl_input_iterator_impl@objects@python@boost@@QEAAXXZ) referenced in function "private: static void __cdecl boost::iterators::iterator_core_access::increment<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > &)" (??$increment@U?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@@iterator_core_access@iterators@boost@@CAXAEAU?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@2@@Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl boost::python::objects::stl_input_iterator_impl::increment(void)" (__imp_?increment@stl_input_iterator_impl@objects@python@boost@@QEAAXXZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl boost::python::objects::stl_input_iterator_impl::equal(struct boost::python::objects::stl_input_iterator_impl const &)const " (__imp_?equal@stl_input_iterator_impl@objects@python@boost@@QEBA_NAEBU1234@@Z) referenced in function "bool __cdecl boost::iterators::operator!=<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64,struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64>(class boost::iterators::iterator_facade<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64> const &,class boost::iterators::iterator_facade<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64> const &)" (??$?9U?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uinput_iterator_tag@4@V34@_JU012@V34@U54@V34@_J@iterators@boost@@YA_NAEBV?$iterator_facade@U?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uinput_iterator_tag@5@V45@_J@01@0@Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl boost::python::objects::stl_input_iterator_impl::equal(struct boost::python::objects::stl_input_iterator_impl const &)const " (__imp_?equal@stl_input_iterator_impl@objects@python@boost@@QEBA_NAEBU1234@@Z)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::python::handle<struct _object> const & __cdecl boost::python::objects::stl_input_iterator_impl::current(void)const " (__imp_?current@stl_input_iterator_impl@objects@python@boost@@QEBAAEBV?$handle@U_object@@@34@XZ) referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl boost::iterators::iterator_core_access::dereference<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (??$dereference@U?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@@iterator_core_access@iterators@boost@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBU?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@2@@Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class boost::python::handle<struct _object> const & __cdecl boost::python::objects::stl_input_iterator_impl::current(void)const " (__imp_?current@stl_input_iterator_impl@objects@python@boost@@QEBAAEBV?$handle@U_object@@@34@XZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::~stl_input_iterator_impl(void)" (__imp_??1stl_input_iterator_impl@objects@python@boost@@QEAA@XZ) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::~stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??1?$stl_input_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@QEAA@XZ)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::~stl_input_iterator_impl(void)" (__imp_??1stl_input_iterator_impl@objects@python@boost@@QEAA@XZ)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct boost::python::detail::dict_base & __cdecl boost::python::detail::dict_base::operator=(struct boost::python::detail::dict_base &&)" (__imp_??4dict_base@detail@python@boost@@QEAAAEAU0123@$$QEAU0123@@Z) referenced in function "public: class boost::python::dict & __cdecl boost::python::dict::operator=(class boost::python::dict &&)" (??4dict@python@boost@@QEAAAEAV012@$$QEAV012@@Z)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(struct boost::python::objects::stl_input_iterator_impl const &)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@AEBU0123@@Z) referenced in function "public: __cdecl std::vector<int,class std::allocator<int> >::vector<int,class std::allocator<int> ><struct boost::python::stl_input_iterator<int const >,void>(struct boost::python::stl_input_iterator<int const >,struct boost::python::stl_input_iterator<int const >,class std::allocator<int> const &)" (??$?0U?$stl_input_iterator@$$CBH@python@boost@@X@?$vector@HV?$allocator@H@std@@@std@@QEAA@U?$stl_input_iterator@$$CBH@python@boost@@0AEBV?$allocator@H@1@@Z)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(struct boost::python::objects::stl_input_iterator_impl &&)" (__imp_??0stl_input_iterator_impl@objects@python@boost@@QEAA@$$QEAU0123@@Z) referenced in function "public: __cdecl std::vector<int,class std::allocator<int> >::vector<int,class std::allocator<int> ><struct boost::python::stl_input_iterator<int const >,void>(struct boost::python::stl_input_iterator<int const >,struct boost::python::stl_input_iterator<int const >,class std::allocator<int> const &)" (??$?0U?$stl_input_iterator@$$CBH@python@boost@@X@?$vector@HV?$allocator@H@std@@@std@@QEAA@U?$stl_input_iterator@$$CBH@python@boost@@0AEBV?$allocator@H@1@@Z)
bin\msvc-14.1\release\address-model-64\libtorrent.dll : fatal error LNK1120: 11 unresolved externals
检查libboost_python-vc141-mt-1_65_1.lib
C:\boost_1_65_1\stage\lib
时(使用dumpbin /EXPORTS
)我检查了dumpbin输出中是否存在所有符号,例如搜索identity_function
我得到的06B 00000000 SECT28 notype () External | ?identity_function@objects@python@boost@@YAAEBVobject@api@23@XZ (class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void))
这一行:
Boost.Python
我在我的JamFile中包含了这个lib文件。我还缺少什么?在构建bjam --with-python variant=release address-model=64
时我是否需要通过一些选项,目前我正在使用left()
构建它
答案 0 :(得分:0)
根据RbMm的建议,我在JamFile中包含了库,并删除了许多未解决的外部符号错误。其余的错误是通过将Boost.Python构建为共享并包含lib文件来修复的。现在我有一个完全不同的无关错误。