首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么boost python构建的库没有任何导出功能?

问为什么boost python构建的库没有任何导出功能?
EN

Stack Overflow用户
提问于 2014-05-20 16:59:02
回答 1查看 433关注 0票数 0

我构建了boost python (1.55),没有任何错误或警告。以下是清单:

代码语言:javascript
复制
C:\Programming\boost>b2 toolset=msvc-11.0 link=static variant=release threading=multi runtime-link=static --with-python
link.jam: No such file or directory
Building the Boost C++ Libraries.

Component configuration:
    - atomic                   : not building
    - chrono                   : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building

...patience...
...patience...
...found 1654 targets...
...updating 30 targets...
compile-c-c++ bin.v2\libs\python\build\msvc-11.0\release\link-static\runtime-link-static\threading-multi\numeric.obj
numeric.cpp
..........................
compile-c-c++ bin.v2\libs\python\build\msvc-11.0\release\link-static\runtime-link-static\threading-multi\object\function_doc_signature.obj
function_doc_signature.cpp
msvc.archive bin.v2\libs\python\build\msvc-11.0\release\link-static\runtime-link-static\threading-multi\libboost_python-vc110-mt-s-1_55.lib
common.copy stage\lib\libboost_python-vc110-mt-s-1_55.lib
bin.v2\libs\python\build\msvc-11.0\release\link-static\runtime-link-static\threading-multi\libboost_python-vc110-mt-s-1_55.lib
Скопировано файлов:         1.
...updated 30 targets...

The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
    C:/Programming/boost
The following directory should be added to linker library paths:
    C:\Programming\boost\stage\lib
C:\Programming\boost>

编辑:

但是,如果我将它添加到我的项目中(引用->链接器->输入->附加依赖项),则会得到链接器错误,例如:

代码语言:javascript
复制
PyRunnable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __cdecl boost::python::api::getitem(class boost::python::api::object const &,class boost::python::api::object const &)" (__imp_?getitem@api@python@boost@@YA?AVobject@123@ABV4123@0@Z)
PyRunnable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __cdecl boost::python::api::getattr(class boost::python::api::object const &,char const *)" (__imp_?getattr@api@python@boost@@YA?AVobject@123@ABV4123@PBD@Z)
PyRunnable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: __thiscall boost::python::detail::str_base::str_base(void)" (__imp_??0str_base@detail@python@boost@@IAE@XZ)

如果我使用dumpbin /symbols,我甚至可以找到未解决的方法。所以,他们在里面,但是VS2012不知怎么地忽略了他们。为什么?

在附加依赖项字段中有:

代码语言:javascript
复制
libboost_system-vc110-mt-1_55.lib
libboost_program_options-vc110-mt-1_55.lib
libboost_filesystem-vc110-mt-1_55.lib

和他们没有任何问题。但是,如果添加libboost_python-vc120-mt-1_55.lib或否,我仍然会得到15个链接器错误。我做错什么了?

提前谢谢你。

EN

回答 1

Stack Overflow用户

发布于 2014-05-20 17:26:09

这很正常。dumpbin /exports选项用于显示从PE文件导出的函数(例如DLL),而不是将函数列出在/exports库中。

若要列出COFF库中的函数,请使用/symbols选项:

代码语言:javascript
复制
dumpbin /symbols libboost_python-vc110-mt-s-1_55.lib
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23765822

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档