release是提示错误Linking...
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) already defined in rts_scene_area.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) already defined in cmd_svr.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already
defined in LIBCMT.lib(stdexcpt.obj)忽略掉库msvcprt.lib MSVCRT.lib 仍然提示以上错误请问各位是不是项目需要其他什么设置?我是在Runtime Lib 为Multi-threaded (/MT)下编译的
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) already defined in rts_scene_area.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) already defined in cmd_svr.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already
defined in LIBCMT.lib(stdexcpt.obj)忽略掉库msvcprt.lib MSVCRT.lib 仍然提示以上错误请问各位是不是项目需要其他什么设置?我是在Runtime Lib 为Multi-threaded (/MT)下编译的
在也使用 /clr 时混合静态库和动态库。
该符号为封装函数(通过用 /Gy 编译创建),包含在多个文件中,但在各编译间已改变。重新编译所有包含 symbol 的文件。
以不同的形式在不同库中的两个成员对象中定义了该符号,并且使用了这两个成员对象。
某个绝对符号被定义两次,而每次定义的值不同。
头文件声明并定义了变量。可能的解决方案有:
在 .h 中声明变量:extern BOOL MyBool;,然后在 .c 或 .cpp 文件中向它分配:BOOL MyBool = FALSE;。
将变量声明为 static。
将变量声明为 selectany。
当将 uuid.lib 与定义 GUID 的其他 .lib 文件(例如 oledb.lib 和 adsiid.lib)一起使用时。例如:
oledb.lib(oledb_i.obj) : error LNK2005: _IID_ITransactionObject
already defined in uuid.lib(go7.obj)
若要修复,请将 /FORCE:MULTIPLE 添加到链接器命令行选项,并确保 uuid.lib 是引用的第一个库。 有关更多信息,请参见知识库文章: Q148652,PRB: LNK2005 Errors When Link C Run-Time Libraries Are Linked Before MFC Libraries。
Q140440,FIX: Global Overloaded Delete Operator Causes LNK2005。
Q184235,PRB: LNK2005 Errors on New and Delete When Defining _ATL_MIN_CRT。
CGlobalObject *GetGlobalObj()
{
g_sysObj = new CGlobalObject;
g_sysObj->init();
g_sysObj->Register("script");
return g_sysObj;
}
在其他文件中包含这个头文件调用GetGlobalObj()应该不会有问题吧?
原因是Debug 时间忽略了一些库,而release是不需要忽略的