bravery
24-04-2006 20:23:25
I have define the world like this:
OgreNewt::World* m_World;
and inside createscene method I call it like this:
m_World = new OgreNewt::World();
after I add the previous line and build my code I will have the following error:
Compiling...
oSceneLibDemo.cpp
Linking...
oSceneLibDemo.obj : error LNK2019: unresolved external symbol "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ) referenced in function "protected: virtual void __thiscall oSceneLibApplication::createScene(void)" (?createScene@oSceneLibApplication@@MAEXXZ)
.\..\bin\Release/Demo_oSceneLoader.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://e:\programming\OgreSDK\samples\obj\Release\BuildLog.htm"
Demo_oSceneLoader - 2 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
I'm using Dagon 1.2 Rc2
so why this happen any help here?
CaseyB
24-04-2006 20:43:22
Did you add the OgreNewt.lib to the linker inputs?
bravery
24-04-2006 20:52:21
thanks for your fast help man
I add it to the linker as you told me, but nkow when I compile I have the following problem:
Linking...
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) already defined in libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) already defined in tinyxmlparser.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) already defined in tinyxmlparser.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) already defined in libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in tinyxmlparser.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 oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in OgreOSMScene.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) already defined in oSceneLibDemo.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) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcp.lib(uncaught.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: bool __thiscall std::basic_istream<char,struct std::char_traits<char> >::_Ipfx(bool)" (?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::snextc(void)" (?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::append(unsigned int,char)" (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sgetc(void)" (?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::locale::~locale(void)" (??1locale@std@@QAE@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale __thiscall std::ios_base::getloc(void)const " (?getloc@ios_base@std@@QBE?AVlocale@2@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sbumpc(void)" (?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in tinyxml.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _sprintf already defined in LIBC.lib(sprintf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonUpdate referenced in function "public: void __thiscall OgreNewt::World::update(float)" (?update@World@OgreNewt@@QAEXM@Z)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonGetTimeStep referenced in function "public: float __thiscall OgreNewt::World::getTimeStep(void)const " (?getTimeStep@World@OgreNewt@@QBEMXZ)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonSetWorldSize referenced in function "public: void __thiscall OgreNewt::World::setWorldSize(class Ogre::Vector3 const &,class Ogre::Vector3 const &)" (?setWorldSize@World@OgreNewt@@QAEXABVVector3@Ogre@@0@Z)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonDestroy referenced in function "public: __thiscall OgreNewt::World::~World(void)" (??1World@OgreNewt@@QAE@XZ)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetDefaultGroupID referenced in function "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonWorldSetUserData referenced in function "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonCreate referenced in function "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonBodyGetUserData referenced in function "private: static void __cdecl OgreNewt::World::newtonLeaveWorld(struct NewtonBody const *)" (?newtonLeaveWorld@World@OgreNewt@@CAXPBUNewtonBody@@@Z)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonWorldGetUserData referenced in function "private: static void __cdecl OgreNewt::World::newtonLeaveWorld(struct NewtonBody const *)" (?newtonLeaveWorld@World@OgreNewt@@CAXPBUNewtonBody@@@Z)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonBodyGetWorld referenced in function "private: static void __cdecl OgreNewt::World::newtonLeaveWorld(struct NewtonBody const *)" (?newtonLeaveWorld@World@OgreNewt@@CAXPBUNewtonBody@@@Z)
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2019: unresolved external symbol __imp__NewtonSetBodyLeaveWorldEvent referenced in function "public: void __thiscall OgreNewt::World::setLeaveWorldCallback(class boost::function<void __cdecl(class OgreNewt::Body *),class std::allocator<void> >)" (?setLeaveWorldCallback@World@OgreNewt@@QAEXV?$function@$$A6AXPAVBody@OgreNewt@@@ZV?$allocator@X@std@@@boost@@@Z)
OgreNewt_Main.lib(OgreNewt_Debugger.obj) : error LNK2019: unresolved external symbol __imp__NewtonBodyForEachPolygonDo referenced in function "private: static void __cdecl OgreNewt::Debugger::newtonPerBody(struct NewtonBody const *)" (?newtonPerBody@Debugger@OgreNewt@@CAXPBUNewtonBody@@@Z)
OgreNewt_Main.lib(OgreNewt_Debugger.obj) : error LNK2019: unresolved external symbol __imp__NewtonWorldForEachBodyDo referenced in function "public: void __thiscall OgreNewt::Debugger::showLines(class OgreNewt::World *)" (?showLines@Debugger@OgreNewt@@QAEXPAVWorld@2@@Z)
OgreNewt_Main.lib(OgreNewt_MaterialID.obj) : error LNK2019: unresolved external symbol __imp__NewtonMaterialCreateGroupID referenced in function "public: __thiscall OgreNewt::MaterialID::MaterialID(class OgreNewt::World const *)" (??0MaterialID@OgreNewt@@QAE@PBVWorld@1@@Z)
.\..\bin\Release/Demo_oSceneLoader.exe : fatal error LNK1120: 14 unresolved externals
Build log was saved at "file://e:\programming\OgreSDK\samples\obj\Release\BuildLog.htm"
Demo_oSceneLoader - 50 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
I like to note that:
I'm trying to use OgreNewt with oFusion framework so I'm including the tinyxml .
so please help and if you need more description about the problem just ask.
bravery
24-04-2006 22:09:27
I have solve a part of the problem
I add to the linker input newton.lib and this descrese the errors from 50 to 36 error
but still have the following problem:
Linking...
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) already defined in libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) already defined in tinyxmlparser.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) already defined in tinyxmlparser.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) already defined in libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in tinyxmlparser.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 oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in OgreOSMScene.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) already defined in oSceneLibDemo.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) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcp.lib(uncaught.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: bool __thiscall std::basic_istream<char,struct std::char_traits<char> >::_Ipfx(bool)" (?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in tinyxml.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::snextc(void)" (?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::append(unsigned int,char)" (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sgetc(void)" (?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::locale::~locale(void)" (??1locale@std@@QAE@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale __thiscall std::ios_base::getloc(void)const " (?getloc@ios_base@std@@QBE?AVlocale@2@XZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sbumpc(void)" (?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in tinyxmlparser.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in tinyxml.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _sprintf already defined in LIBC.lib(sprintf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
.\..\bin\Release/Demo_oSceneLoader.exe : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://e:\programming\OgreSDK\samples\obj\Release\BuildLog.htm"
Demo_oSceneLoader - 36 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
any suggestion to solve this problem?
CaseyB
24-04-2006 22:31:08
It looks like you are adding too much to your project, like you added the tinyXML stuff to your project and are also linking it in externally... But I am really not sure!
bravery
24-04-2006 22:39:57
what should I do to solve please give me suggestions I feel lost
CaseyB
24-04-2006 22:50:36
Well, you said that you added the TinyXML files to your project, did you also add them to the include path? If so then you should get rid of one of them. If you decide to remove the TinyXML files from your project then you'll seen to change the include directives to look like #include <TinyXML.h> instead of #include "TinlyXML.h". If you decide to remove them from the linker path you'll need to do the opposite.
bravery
24-04-2006 23:04:34
ok I have remove the tinyxml files from my project and add it's path to the project include path
this decrease the errors from 36 error to 20 error, and this is the new error result:
Compiling...
OgreOSMScene.cpp
oSceneLibDemo.cpp
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> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in OgreOSMScene.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) already defined in oSceneLibDemo.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) already defined in oSceneLibDemo.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in OgreOSMScene.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in oSceneLibDemo.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _sprintf already defined in LIBC.lib(sprintf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
OgreOSMScene.obj : error LNK2019: unresolved external symbol "public: class TiXmlElement * __thiscall TiXmlNode::FirstChildElement(void)" (?FirstChildElement@TiXmlNode@@QAEPAVTiXmlElement@@XZ) referenced in function "public: class TiXmlElement * __thiscall TiXmlDocument::RootElement(void)" (?RootElement@TiXmlDocument@@QAEPAVTiXmlElement@@XZ)
OgreOSMScene.obj : error LNK2019: unresolved external symbol "public: __thiscall TiXmlDocument::TiXmlDocument(void)" (??0TiXmlDocument@@QAE@XZ) referenced in function "public: bool __thiscall OSMScene::initialise(char const *,class OSMSceneCallbacks *)" (?initialise@OSMScene@@QAE_NPBDPAVOSMSceneCallbacks@@@Z)
OgreOSMScene.obj : error LNK2019: unresolved external symbol "public: class TiXmlElement * __thiscall TiXmlNode::NextSiblingElement(void)" (?NextSiblingElement@TiXmlNode@@QAEPAVTiXmlElement@@XZ) referenced in function $L138952
OgreOSMScene.obj : error LNK2019: unresolved external symbol "public: class TiXmlElement * __thiscall TiXmlNode::FirstChildElement(char const *)" (?FirstChildElement@TiXmlNode@@QAEPAVTiXmlElement@@PBD@Z) referenced in function $L138952
OgreOSMScene.obj : error LNK2019: unresolved external symbol "public: char const * __thiscall TiXmlElement::Attribute(char const *)const " (?Attribute@TiXmlElement@@QBEPBDPBD@Z) referenced in function "private: class Ogre::SceneNode * __thiscall OSMScene::createNode(class TiXmlElement *,class Ogre::SceneNode *)" (?createNode@OSMScene@@AAEPAVSceneNode@Ogre@@PAVTiXmlElement@@PAV23@@Z)
.\..\bin\Release/Demo_oSceneLoader.exe : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://e:\programming\OgreSDK\samples\obj\Release\BuildLog.htm"
Demo_oSceneLoader - 20 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
so please give me more suggestions
Regards
BergBoy
25-04-2006 04:21:10
uhm... give it a rebuild (if u havnt already done so) and check what your linking to with oSceneLibDemo.cpp. It looks like tinyXML stuff. Maybe a wrong version or two many versions or only half a version. its hard to tell. Maybe mixed version. Check whatever code its linking to and ensure its:
- Being linked correctly and fully (no missing headers or libs and all code is from the same version)
- Not being linked from two locations
It looks like tinyXML errors tho. Thats my best help, sorry if it isnt much
bravery
25-04-2006 07:39:24
thanks guys I have sloved the problem
the main error is that I should make the project multithreaded (/MD)
this solve the problem
thanks again
I had this problem too ( change /MT to /MD in c++/code generation solved it ). But I have question: Will be my application work on other systems? without Visual Studio? with /MD flag?