技术文章 - CS217302

在编译一个包含两个 Creo Parametric Object TOOLKIT C++ 项目的解决方案时,出现错误 LNK2005。

已修改: 06-Sep-2015   


适用于

  • Creo Parametric 3.0 M030

说明

  • 在编译一个包含两个 Creo Parametric Object TOOLKIT C++ 项目的解决方案时,出现错误 LNK2005
  • 示例错误信息:
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(class xstring const &)" (??0xstring@@QEAA@AEBV0@@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::~xstring(void)" (??1xstring@@QEAA@XZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: struct __xstring_c __cdecl xstring::getxstring_c(void)const " (?getxstring_c@xstring@@QEBA?AU__xstring_c@@XZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(void)" (??0xstring@@QEAA@XZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(char const *)" (??0xstring@@QEAA@PEBD@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring & __cdecl xstring::operator=(char const *)" (??4xstring@@QEAAAEAV0@PEBD@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring & __cdecl xstring::operator=(class xstring const &)" (??4xstring@@QEAAAEAV0@AEBV0@@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring & __cdecl xstring::operator+=(char const *)" (??Yxstring@@QEAAAEAV0@PEBD@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring & __cdecl xstring::operator+=(class xstring const &)" (??Yxstring@@QEAAAEAV0@AEBV0@@Z) already defined in otk_cpp_md.lib(services.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: static class xstring __cdecl xstring::Printf(char const *,...)" (?Printf@xstring@@SA?AV1@PEBDZZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "private: char const * __cdecl xstring::CastToCString(void)const " (?CastToCString@xstring@@AEBAPEBDXZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(wchar_t const *)" (??0xstring@@QEAA@PEB_W@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::operator char const *(void)const " (??Bxstring@@QEBAPEBDXZ) already defined in otk_cpp_md.lib(services.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: bool __cdecl xstring::IsEmpty(void)const " (?IsEmpty@xstring@@QEBA_NXZ) already defined in otk_cpp_md.lib(services.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: int __cdecl xstring::GetLength(void)const " (?GetLength@xstring@@QEBAHXZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring __cdecl xstring::Substring(int,int)const " (?Substring@xstring@@QEBA?AV1@HH@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: int __cdecl xstring::Pos(char const *)const " (?Pos@xstring@@QEBAHPEBD@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: bool __cdecl xstring::Match(class xstring const &)const " (?Match@xstring@@QEBA_NAEBV1@@Z) already defined in otk_cpp_md.lib(services.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(char const *,char const *)" (??0xstring@@QEAA@PEBD0@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: bool __cdecl xstring::ToInt(int *)const " (?ToInt@xstring@@QEBA_NPEAH@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring __cdecl xstring::ToLower(void)const " (?ToLower@xstring@@QEBA?AV1@XZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: bool __cdecl xstring::Match(char const *)const " (?Match@xstring@@QEBA_NPEBD@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "private: wchar_t const * __cdecl xstring::CastToCWString(void)const " (?CastToCWString@xstring@@AEBAPEB_WXZ) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: __cdecl xstring::xstring(char const *,int)" (??0xstring@@QEAA@PEBDH@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
    2>Server.lib(Server.dll) : error LNK2005: "public: class xstring & __cdecl xstring::operator+=(char)" (??Yxstring@@QEAAAEAV0@D@Z) already defined in otk_cpp_md.lib(strlibsrc.obj)
这是文章 217302 的 PDF 版本,可能已过期。最新版本 CS217302