为什么boost python内置库没有任何导出功能



我构建boost python(1.55)没有任何错误或警告。下面是列表:

C:Programmingboost>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.v2libspythonbuildmsvc-11.0releaselink-staticruntime-link-staticthreading-multinumeric.obj
numeric.cpp
..........................
compile-c-c++ bin.v2libspythonbuildmsvc-11.0releaselink-staticruntime-link-staticthreading-multiobjectfunction_doc_signature.obj
function_doc_signature.cpp
msvc.archive bin.v2libspythonbuildmsvc-11.0releaselink-staticruntime-link-staticthreading-multilibboost_python-vc110-mt-s-1_55.lib
common.copy stageliblibboost_python-vc110-mt-s-1_55.lib
bin.v2libspythonbuildmsvc-11.0releaselink-staticruntime-link-staticthreading-multilibboost_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:Programmingbooststagelib
C:Programmingboost>

编辑:

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

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不知何故忽略了它们。为什么?

在Additional dependencies字段中有:

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个链接器错误。我做错了什么?

提前感谢。

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

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

dumpbin /symbols libboost_python-vc110-mt-s-1_55.lib

相关内容

  • 没有找到相关文章

最新更新