提问:关于boost python

tomb4 2005-02-21 03:55:00
vc7.1中。编译成功以后,发现dll的可用,lib的(就是libboost_python.lib)在用的时候编译发生链接错误。发现似乎是要预定义BOOST_PYTHON_STATIC_LIB。定义之后,又出现了新的链接错误:
请问怎么解决?





正在链接...
LINK : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/INCREMENTAL:NO”规范)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) 已经在 libcpd.lib(locale0.obj) 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static unsigned int __cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)" (?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z) 已经在 libcpd.lib(cout.obj) 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z) 已经在 libcpd.lib(locale0.obj) 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) 已经在 py_embedded_python.obj 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::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> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) 已经在 libcpd.lib(ios.obj) 中定义
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) 已经在 py_embedded_python.obj 中定义


。。。(省略)


MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: virtual __thiscall bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ) 已在 LIBCD.lib(stdexcpt.obj) 中定义;已忽略第二个定义
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall bad_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z) 已在 LIBCD.lib(stdexcpt.obj) 中定义;已忽略第二个定义
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: int __thiscall type_info::before(class type_info const &)const " (?before@type_info@@QBEHABV1@@Z) 已在 LIBCD.lib(typinfo.obj) 中定义;已忽略第二个定义
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) 已在 LIBCD.lib(typinfo.obj) 中定义;已忽略第二个定义
MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) 已在 LIBCD.lib(stdexcpt.obj) 中定义;已忽略第二个定义
MSVCRT.lib(ti_inst.obj) : warning LNK4006: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已在 LIBCD.lib(typinfo.obj) 中定义;已忽略第二个定义
MSVCRT.lib(ti_inst.obj) : warning LNK4006: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) 已在 LIBCD.lib(typinfo.obj) 中定义;已忽略第二个定义
正在创建库 .\Debug/py_embedded_python.lib 和对象 .\Debug/py_embedded_python.exp
LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;使用 /NODEFAULTLIB:library
.\Debug/py_embedded_python.exe : fatal error LNK1169: 找到一个或多个多重定义的符号
...全文
576 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wshcdr 2005-03-05
  • 打赏
  • 举报
回复
顶一下
naive1010 2005-03-02
  • 打赏
  • 举报
回复
为什么我在VC6下就是编译不过!!?有什么特别的设定嘛?
yjh1982 2005-03-02
  • 打赏
  • 举报
回复
编译boost.python用的就是vc的标准库
....
编译一个lib的时候根本不需要link另一个lib
naive1010 2005-03-02
  • 打赏
  • 举报
回复
关注ing.....
sharkhuang 2005-02-23
  • 打赏
  • 举报
回复
连接了2次MSVCRT.lib~
constantine 2005-02-22
  • 打赏
  • 举报
回复
如果在其他的工具里可能lib用不了
tomb4 2005-02-21
  • 打赏
  • 举报
回复
这样的:我的程序里面并没有直接链接MSVCRT.lib等库。
这些库是vc的标准库runtime把,主要我编译boost.python用的就是vc的标准库,并没有用stlport,估计是不是这方面的原因?

Dong 2005-02-21
  • 打赏
  • 举报
回复
MSVCRT.lib//把这个从包含库里去掉

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧