kvng
asked on
error Lnk2001: unresolved external symbol
Hi,
I have a linking problem after attempting to build the file. The error is as follows:
glovenew.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall vhtIOConn::~vhtIOConn(void )" (??1vhtIOConn@@UAE@XZ)
glovenew.obj : error LNK2001: unresolved external symbol "public: double __thiscall vhtDevice::getLastUpdateTi me(void)" (?getLastUpdateTime@vhtDev ice@@QAENX Z)
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtTracker::vhtTracker(cla ss vhtIOConn *,bool)" (??0vhtTracker@@QAE@PAVvht IOConn@@_N @Z)
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtCyberGlove::vhtCyberGlo ve(class vhtIOConn *,bool)" (??0vhtCyberGlove@@QAE@PAV vhtIOConn@ @_N@Z)
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtIOConn::vhtIOConn(char const *,char const *,char const *,char const *,char const *)" (??0vhtIOConn@@QAE@PBD0000 @Z)
Debug/glovenew.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
Could anyone tell me what is wrong and how to go about solving it? Thanks.
I have a linking problem after attempting to build the file. The error is as follows:
glovenew.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall vhtIOConn::~vhtIOConn(void
glovenew.obj : error LNK2001: unresolved external symbol "public: double __thiscall vhtDevice::getLastUpdateTi
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtTracker::vhtTracker(cla
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtCyberGlove::vhtCyberGlo
glovenew.obj : error LNK2001: unresolved external symbol "public: __thiscall vhtIOConn::vhtIOConn(char const *,char const *,char const *,char const *,char const *)" (??0vhtIOConn@@QAE@PBD0000
Debug/glovenew.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
Could anyone tell me what is wrong and how to go about solving it? Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to write code for the functions vhtIOConn::~vhtIOConn(void ), vhtDevice::getLastUpdateTi me(void), ...
ASKER
After adding the appropriate library modules, i get the following errors:
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: virtual __thiscall ios::~ios(void)" (??1ios@@UAE@XZ) already defined in libcid.lib(_ios.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: class ostream & __thiscall ostream::operator<<(unsign ed char)" (??6ostream@@QAEAAV0@E@Z) already defined in libcid.lib(ostrchar.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: class ostream & __thiscall ostream::operator<<(char const *)" (??6ostream@@QAEAAV0@PBD@Z ) already defined in libcid.lib(ostream.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in LIBCD.lib(strchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in LIBCD.lib(getenv.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glLoadMatrixd@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glNormal3dv@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glEnd@0
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glVertex3dv@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glBegin@4
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/glovenew.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.
Could you suggest how i could resolve this conflict for these errors? Thanks......
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: virtual __thiscall ios::~ios(void)" (??1ios@@UAE@XZ) already defined in libcid.lib(_ios.obj)
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: class ostream & __thiscall ostream::operator<<(unsign
msvcirt.lib(MSVCIRT.dll) : error LNK2005: "public: class ostream & __thiscall ostream::operator<<(char const *)" (??6ostream@@QAEAAV0@PBD@Z
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in LIBCD.lib(strchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in LIBCD.lib(getenv.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/glovenew.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.
Could you suggest how i could resolve this conflict for these errors? Thanks......
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
LIBCID.LIB - Single threaded, static link
MSVCIRT.LIB - Multithreaded, dynamic link (import library for MSVCI70.DLL)
MSVCIRT.LIB - Multithreaded, dynamic link (import library for MSVCI70.DLL)
The same with LIBCD.lib and MSVCRT.lib.
MSVCRT.LIB - Multithreaded, dynamic link (import library for MSVCR70.DLL).
LIBCD.LIB - Single-threaded, static link (debug)
MSVCRT.LIB - Multithreaded, dynamic link (import library for MSVCR70.DLL).
LIBCD.LIB - Single-threaded, static link (debug)
And some functions (__imp__glLoadIdentity, __imp__glLoadMatrixd, ...) are still undefined - you need to add some more lib files.
ASKER
After resolving the library issues and adding the appropriate libraries, i still get the following errors. Please help? Thanks
Linking...
glovenew.obj : error LNK2001: unresolved external symbol "class ostream_withassign cerr" (?cerr@@3Vostream_withassi gn@@A)
glovenew.obj : error LNK2001: unresolved external symbol "public: static int const filebuf::openprot" (?openprot@filebuf@@2HB)
glovenew.obj : error LNK2001: unresolved external symbol "class istream_withassign cin" (?cin@@3Vistream_withassig n@@A)
glovenew.obj : error LNK2001: unresolved external symbol "class ostream_withassign cout" (?cout@@3Vostream_withassi gn@@A)
libVHTDevice.lib(vhtIOConn .obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::Init( void)" (__imp_??0Init@ios_base@st d@@QAE@XZ)
libVHTDevice.lib(vhtIOConn .obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::~Init (void)" (__imp_??1Init@ios_base@st d@@QAE@XZ)
libVHTDevice.lib(vhtIOConn .obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::_Winit(void)" (__imp_??0_Winit@std@@QAE@ XZ)
libVHTDevice.lib(vhtIOConn .obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::~_Winit(void) " (__imp_??1_Winit@std@@QAE@ XZ)
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glLoadMatrixd@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glNormal3dv@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glEnd@0
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glVertex3dv@4
libVHTDevice.lib(vhtOglDra wer.obj) : error LNK2001: unresolved external symbol __imp__glBegin@4
glovenew___Win32_Debug/glo venew.exe : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.
Linking...
glovenew.obj : error LNK2001: unresolved external symbol "class ostream_withassign cerr" (?cerr@@3Vostream_withassi
glovenew.obj : error LNK2001: unresolved external symbol "public: static int const filebuf::openprot" (?openprot@filebuf@@2HB)
glovenew.obj : error LNK2001: unresolved external symbol "class istream_withassign cin" (?cin@@3Vistream_withassig
glovenew.obj : error LNK2001: unresolved external symbol "class ostream_withassign cout" (?cout@@3Vostream_withassi
libVHTDevice.lib(vhtIOConn
libVHTDevice.lib(vhtIOConn
libVHTDevice.lib(vhtIOConn
libVHTDevice.lib(vhtIOConn
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
libVHTDevice.lib(vhtOglDra
glovenew___Win32_Debug/glo
Error executing link.exe.
What libraries are now connected to the project? Show me all the names.
ASKER
Hi,
i've managed to solve the problem. It appears that the toolkit i'm using requires the Code generation to be set to 'dll multi-threaded debug' mode and that has been causing the problem.
Thank you for the help.........
i've managed to solve the problem. It appears that the toolkit i'm using requires the Code generation to be set to 'dll multi-threaded debug' mode and that has been causing the problem.
Thank you for the help.........
Can I also thank you for your help, I'ver struggled with this problem for ages!!!
Hi
I am trying to use Log4cxx in my source code . All i got was a set of header files for this api ... which I have included in my source and it compiles fine . But it gives a linker error mentioned below. Do I need to register some dll for Log4cxx or just including the header files is enuff' . Also The code generation is set to debug multi threaded dll .
Following is the error that i am getting. Any help would be appreciated.
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::Logger::forcedLog (class log4cxx::helpers::ObjectPt rT<class log4cxx::Level> const &,class std::basic_string<char,str uct std::char_traits<cha
r>,class std::allocator<char> > const &,char const *,int)" (__imp_?forcedLog@Logger@l og4cxx@@QA EXABV?$Obj ectPtrT@VL evel@log4c xx@@@helpe rs@2@ABV?$ basic_stri ng@DU?$cha r_traits@D @std@@V?$a llocator@D @2@@std@@P BDH@Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall log4cxx::Logger::isInfoEna bled(void) const " (__imp_?isInfoEnabled@Logg er@log4cxx @@QBE_NXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPt rT<class log4cxx::Level> const log4cxx::Level::INFO" (__imp_?INFO@Level@log4cxx @@2V?$Obje ctPtrT@VLe vel@log4cx x@@@helper s@2@B
)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::FileAppender::set File(class std::basic_string<char,str uct std::char_traits<char>,cla ss std::allocator<char> > const &)" (__imp_?setFile@Fil
eAppender@log4cxx@@QAEXABV ?$basic_st ring@DU?$c har_traits @D@std@@V? $allocator @D@2@@std@ @@Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall log4cxx::FileAppender::Fil eAppender( void)" (__imp_??0FileAppender@log 4cxx@@QAE@ XZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::Class const & __cdecl log4cxx::Appender::getStat icClass(vo id)" (__imp_?getStaticClass@App ender@log4 cxx@@SAABV Class@help ers@2@XZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual class log4cxx::helpers::Class const & __thiscall log4cxx::FileAppender::get Class(void )const " (__imp_?getClass@FileAppen der@log4cx x@@UBEABVC lass@helpe rs@2@X
Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::FileAppender::`vb ase destructor'(void)" (__imp_??_DFileAppender@lo g4cxx@@QAE XXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::addRef (void)cons t " (__imp_?addRef@ObjectImpl@ helpers@lo g4cxx@@UBE XXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::releas eRef(void) const " (__imp_?releaseRef@ObjectI mpl@helper s@log4cxx@ @UBEXXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::lock(v oid)const " (__imp_?lock@ObjectImpl@he lpers@log4 cxx@@UBEXX Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::unlock (void)cons t " (__imp_?unlock@ObjectImpl@ helpers@lo g4cxx@@UBE XXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::wait(v oid)const " (__imp_?wait@ObjectImpl@he lpers@log4 cxx@@UBEXX Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::notify (void)cons t " (__imp_?notify@ObjectImpl@ helpers@lo g4cxx@@UBE XXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm pl::notify All(void)c onst " (__imp_?notifyAll@ObjectIm pl@helpers @log4cxx@@ UBEXXZ)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall log4cxx::FileAppender::ins tanceof(cl ass log4cxx::helpers::Class const &)const " (__imp_?instanceof@FileApp ender@log4 cxx@@UBE_N ABVClass@h elpe
rs@2@@Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void const * __thiscall log4cxx::FileAppender::cas t(class log4cxx::helpers::Class const &)const " (__imp_?cast@FileAppender@ log4cxx@@U BEPBXABVCl ass@helper s@
2@@Z)
EVPricingService___Win32_C onsole_Deb ug/EVPrici ngService. exe : fatal error LNK1120: 17 unresolved externals
I am trying to use Log4cxx in my source code . All i got was a set of header files for this api ... which I have included in my source and it compiles fine . But it gives a linker error mentioned below. Do I need to register some dll for Log4cxx or just including the header files is enuff' . Also The code generation is set to debug multi threaded dll .
Following is the error that i am getting. Any help would be appreciated.
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::Logger::forcedLog
r>,class std::allocator<char> > const &,char const *,int)" (__imp_?forcedLog@Logger@l
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall log4cxx::Logger::isInfoEna
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::ObjectPt
)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::FileAppender::set
eAppender@log4cxx@@QAEXABV
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall log4cxx::FileAppender::Fil
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class log4cxx::helpers::Class const & __cdecl log4cxx::Appender::getStat
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual class log4cxx::helpers::Class const & __thiscall log4cxx::FileAppender::get
Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::FileAppender::`vb
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall log4cxx::helpers::ObjectIm
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall log4cxx::FileAppender::ins
rs@2@@Z)
evapp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void const * __thiscall log4cxx::FileAppender::cas
2@@Z)
EVPricingService___Win32_C
thnx
luv u for that
gr8t
gr8t
vhtIOConn::~vhtIOConn
vhtDevice::getLastUpdateTi
...
For example:
class a
{
A(); // only declaration, no implementation
};
// client.cpp
...
A a; // compiles, but produces linker error: A::A is not implemented