提问:关于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: 找到一个或多个多重定义的符号