What steps will reproduce the problem?
1. svn checkout http://ticpp.googlecode.com/svn/trunk/ ticpp ( checked out
revision 124 )
2. cd ticpp && premake4 vs2008
3. Open and build in vs2010, converting project to vs2010 format when prompted
Use the following test program or similar:
#pragma comment(lib, "ticppd.lib")
#include <ticpp.h>
void TinyXmlAllThat();
int _tmain(int argc, _TCHAR* argv[])
{
TinyXmlAllThat();
std::cin.get();
return 0;
}
void TinyXmlAllThat()
{
try
{
ticpp::Document doc( "c:\\tiny.xml" );
doc.LoadFile();
ticpp::Element* pElem = doc.FirstChildElement();
}
catch( const ticpp::Exception & ex )
{
std::cout << ex.what();
}
}
What is the expected output? What do you see instead?
Expect link stage to succeed. Instead, I get the linker errors pasted at the
end of this message
What version of the product are you using? On what operating system?
OS platform is Windows 7 x64, VS2010, ticpp revision 124.
1>------ Build started: Project: ScratchMe, Configuration: Debug Win32 ------
1> stdafx.cpp
1> ScratchMe.cpp
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: int __thiscall
std::basic_istream<char,struct std::char_traits<char> >::get(void)"
(?get@[email protected][email protected]@std@@@std@@QAEHXZ) already defined in
ticppd.lib(tinyxmlparser.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)"
([email protected][email protected]@std@@@std@@[email protected]@Z) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct
std::char_traits<char> >(void)"
([email protected][email protected]@std@@@std@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_ostream<char,struct std::char_traits<char>
>::~basic_ostream<char,struct std::char_traits<char> >(void)"
([email protected][email protected]@std@@@std@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::basic_ostream<char,struct std::char_traits<char>
>::basic_ostream<char,struct std::char_traits<char> >(class
std::basic_streambuf<char,struct std::char_traits<char> > *,bool)"
([email protected][email protected]@std@@@std@@[email protected][email protected]?$ch
[email protected]@std@@@1@[email protected]) already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: __thiscall
std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct
std::char_traits<char> >(void)"
([email protected][email protected]@std@@@std@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_streambuf<char,struct std::char_traits<char>
>::~basic_streambuf<char,struct std::char_traits<char> >(void)"
([email protected][email protected]@std@@@std@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const "
(?gptr@[email protected][email protected]@std@@@std@@IBEPADXZ) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char
*,char *)" (?setg@[email protected][email protected]@std@@@std@@IA[email protected])
already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *)"
(?setp@[email protected][email protected]@std@@@std@@[email protected]) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::eback(void)const "
(?eback@[email protected][email protected]@std@@@std@@IBEPADXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)"
(?_Pninc@[email protected][email protected]@std@@@std@@IAEPADXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char
*,char *)" (?setp@[email protected][email protected]@std@@@std@@[email protected])
already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::pbase(void)const "
(?pbase@[email protected][email protected]@std@@@std@@IBEPADXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::epptr(void)const "
(?epptr@[email protected][email protected]@std@@@std@@IBEPADXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::pptr(void)const "
(?pptr@[email protected][email protected]@std@@@std@@IBEPADXZ) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::gbump(int)"
(?gbump@[email protected][email protected]@std@@@std@@[email protected]) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: char * __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::egptr(void)const "
(?egptr@[email protected][email protected]@std@@@std@@IBEPADXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::pbump(int)"
(?pbump@[email protected][email protected]@std@@@std@@[email protected]) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Container_base12::~_Container_base12(void)"
(??1_Containe[email protected]@@[email protected]) already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Container_base12::_Container_base12(void)"
([email protected]@@[email protected]) already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall
std::_Container_base12::_Orphan_all(void)"
(?_Orphan_all@[email protected]@@QAEXXZ) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "protected: __thiscall
std::basic_streambuf<char,struct std::char_traits<char>
>::basic_streambuf<char,struct std::char_traits<char> >(void)"
([email protected][email protected]@std@@@std@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall
std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)"
(?setstate@[email protected]?$char_tra[email protected]@std@@@std@@[email protected]) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __int64 __thiscall
std::ios_base::width(__int64)" ([email protected][email protected]@@[email protected]) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __int64 __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const
*,__int64)"
(?sputn@[email protected][email protected]@std@@@std@@[email protected]) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)"
(?sputc@[email protected][email protected]@std@@@std@@[email protected]) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class
std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall
std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const "
(?rdbuf@[email protected][email protected]@std@@@std@@[email protected]?$cha
[email protected]@std@@@[email protected]) already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: char __thiscall
std::basic_ios<char,struct std::char_traits<char> >::fill(void)const "
(?fill@[email protected][email protected]@std@@@std@@QBEDXZ) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: int __thiscall
std::ios_base::flags(void)const " ([email protected][email protected]@@QBEHXZ) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __int64 __thiscall
std::ios_base::width(void)const " ([email protected][email protected]@@QBE_JXZ) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.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@[email protected][email protected]@std@@@std@@[email protected]) already
defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > * __thiscall
std::basic_ios<char,struct std::char_traits<char> >::tie(void)const "
(?tie@[email protected][email protected]@std@@@std@@[email protected]?$char_tr
[email protected]@std@@@[email protected]) already defined in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: bool __thiscall
std::ios_base::good(void)const " ([email protected][email protected]@@QBE_NXZ) already defined
in ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)"
(?_Osfx@[email protected][email protected]@std@@@std@@QAEXXZ) already defined in
ticppd.lib(ticpp.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class
std::locale::facet * __thiscall std::locale::facet::_Decref(void)"
([email protected]@[email protected]@@[email protected]) already defined in
ticppd.lib(ticpp.obj)
1>libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl
std::ios_base::_Ios_base_dtor(class std::ios_base *)"
([email protected][email protected]@@CAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl
std::ios_base::_Addstd(class std::ios_base *)"
([email protected][email protected]@@SAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl
std::locale::facet::_Facet_Register(class std::locale::facet *)"
([email protected]@[email protected]@@CAXPAV123@@Z) already defined in
msvcprtd.lib(locale0_implib.obj)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)"
([email protected]@std@@[email protected]@XZ) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Init(void)"
([email protected]@std@@[email protected]@XZ) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)"
(?_Locinfo_ctor@[email protected]@@[email protected]@Z) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)"
(?_Locinfo_dtor@[email protected]@@SAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" ([email protected]@@[email protected]@Z) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" ([email protected]@@[email protected]) already defined in
msvcprtd.lib(MSVCP100D.dll)
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already
defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetDbgFlag already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtDumpMemoryLeaks already
defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined
in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(lconv.obj) : error LNK2005: _localeconv already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined
in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined
in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf_s already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
(?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LIBCMTD.lib(vsnprnc.obj) : error LNK2005: __vsnprintf_s already defined in
MSVCRTD.lib(MSVCR100D.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function ___tmainCRTStartup
1>C:\Work\ScratchMe\Debug\ScratchMe.exe : fatal error LNK1120: 1 unresolved
externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Original issue reported on code.google.com by [email protected]
on 6 Feb 2012 at 3:26
Type-Defect Priority-Medium auto-migrated