Hi Eric

Check your Runtime Library( MultiThreaded Debug Dll  etc)  and Struct member alignment !!!

They should be same as what you used to compile libpq

Regards
sandeep



On 8/16/06, Eric <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to compile the test001.cxx sample included in the
libpqxx-2.6.7 package, but I get the following linking errors from
Visual Studio .Net 2003:

------ Build started: Project: PostGreSample, Configuration: Release
Win32 ------

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)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
already defined in test001.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 *)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@Z)
already defined in test001.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 &)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@@Z)
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: char const *
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::c_str(void)const "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@QBEPBDXZ)
already defined in libcp.lib(locale0.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)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
already defined in test001.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 *)"
([EMAIL PROTECTED]@D @std@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@Z)
already defined in test001.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> >::assign(char const
*,unsigned int)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@Z)
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::size(void)const "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@QBEIXZ)
already defined in test001.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> >(unsigned int,char)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@ [EMAIL PROTECTED]@Z)
already defined in libcp.lib(cerr.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::ios_base::width(int)" ([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@ [EMAIL PROTECTED]) already
defined in test001.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)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@Z)
already defined in libcp.lib (cerr.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static bool __cdecl
std::char_traits<char>::eq_int_type(int const &,int const &)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED] ) already defined in
test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static int __cdecl
std::char_traits<char>::eof(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@SAHXZ)
already defined in test001.obj
msvcprt.lib(MSVCP71.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 "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@[EMAIL PROTECTED])
already defined in test001.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 "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@QBEIXZ)
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::ios_base::width(void)const " ([EMAIL PROTECTED]@std@@QBEHXZ) already
defined in test001.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)"
([EMAIL PROTECTED]@ [EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@Z)
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::locale::~locale(void)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED] ) already defined in
libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale
__thiscall std::ios_base::getloc(void)const "
([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@XZ) already defined in
libcp.lib(cerr.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char>
>::_Unlock(void)"
([EMAIL PROTECTED]@ [EMAIL PROTECTED]@std@@@std@@QAEXXZ) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@QAEXXZ) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" ([EMAIL PROTECTED]@@ [EMAIL PROTECTED]) already defined
in libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::locale::facet::_Register(void)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@QAEXXZ) already defined in
libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::locale::facet::_Incref(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@QAEXXZ)
already defined in libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static unsigned int
__cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@Z) already defined in
libcp.lib(cerr.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
int)const " ([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@ [EMAIL PROTECTED]) already defined
in libcp.lib(locale0.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::locale::id::operator unsigned int(void)" ([EMAIL PROTECTED]@std@@QAEIXZ)
already defined in libcp.lib(cerr.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@Z) already defined in
libcp.lib(ios.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: char __thiscall
std::basic_ios<char,struct std::char_traits<char> >::widen(char)const "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED]) already
defined in libcp.lib(cerr.obj)
msvcprt.lib(MSVCP71.dll ) : error LNK2005: "public: static int __cdecl
std::char_traits<char>::to_int_type(char const &)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) already defined in test001.obj
msvcprt.lib(MSVCP71.dll ) : error LNK2005: "public: char const &
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::operator[](unsigned int)const "
(??A?$basic_string@ [EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED]) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: char __thiscall
std::basic_ios<char,struct std::char_traits<char> >::fill(void)const "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@QBEDXZ) already defined
in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::ios_base::flags(void)const " ([EMAIL PROTECTED]@std @@QBEHXZ) already
defined in test001.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)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED])
already defined in test001.obj
msvcprt.lib(MSVCP71.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 "
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@[EMAIL PROTECTED])
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: bool __thiscall
std::ios_base::good(void)const " ([EMAIL PROTECTED]@std@@QBE_NXZ) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@@std@@QAEXXZ) already
defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl
std::uncaught_exception(void)" ([EMAIL PROTECTED]@@YA_NXZ) already
defined in libcp.lib(uncaught.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 &)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]@@Z)
already defined in test001.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std::operator<<<struct std::char_traits<char> >(class
std::basic_ostream<char,struct std::char_traits<char> > &,char const *)"
([EMAIL PROTECTED]@std@@@std@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED])
already defined in test001.obj
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall
exception::~exception(void)" (??1exception@@ [EMAIL PROTECTED]) already defined in
LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall
exception::exception(void)" (??0exception@@[EMAIL PROTECTED]) already defined in
LIBC.lib(stdexcpt.obj )
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall
exception::exception(class exception const &)"
(??0exception@@[EMAIL PROTECTED]@@Z) already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll ) : error LNK2005: _strncpy already defined in
LIBC.lib(strncpy.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall
bad_cast::bad_cast(char const *)" (??0bad_cast@@[EMAIL PROTECTED]@Z) already
defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall
exception::exception(char const * const &)" (??0exception@@[EMAIL PROTECTED]@Z)
already defined in LIBC.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
LIBC.lib(atox.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _memmove already defined in
LIBC.lib(memmove.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@[EMAIL PROTECTED]@@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@@[EMAIL PROTECTED]@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
libpqxx_static.lib(connection_base.obj) : error LNK2019: unresolved
external symbol [EMAIL PROTECTED] referenced in function $L84816
Release/PostGreSample.exe : fatal error LNK1120: 1 unresolved externals

Build log was saved at "file://c:\Documents and Settings\eric\Mes
documents\Visual Studio Projects\PostGreSample\Release\BuildLog.htm"
PostGreSample - 54 error(s), 1 warning(s)


---------------------- Done ----------------------

     Build: 0 succeeded, 1 failed, 0 skipped


I'm using the .lib binaries which I compiled from the sources (same for
libpq.lib).
Thanks by advance,
Eric

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq



Reply via email to