By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,581 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

Unresolved STL references

P: n/a
I think you need to link with msvcrt.lib

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
yes. include msvcrt.lib helps linker to find delete and free.

but the following errors appear instead:

Linking...
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol __malloc_dbg
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)

which other libs need to be included ?

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 17 '05 #2

P: n/a
Andrew,
You are running a debug link, so you need msvcrtd.lib. The extra d is
for debug, and will take care of your missing references.
Bob Milton

<andrew> wrote in message news:uu**************@TK2MSFTNGP10.phx.gbl...
yes. include msvcrt.lib helps linker to find delete and free.

but the following errors appear instead:

Linking...
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__malloc_dbg referenced in function "void * __cdecl operator new(unsigned
int,struct std::_DebugHeapTag_t const &,char *,int)"
(??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol
__malloc_dbg
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__free_dbg referenced in function "void __cdecl operator delete(void
*,struct std::_DebugHeapTag_t const &,char *,int)"
(??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)

which other libs need to be included ?

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup
engine supports Post Alerts, Ratings, and Searching.

Nov 17 '05 #3

P: n/a
Thanks.....msvcrtd.lib did the trick for my debug build too....I wonder what msvcrtd.lib stands for.
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 17 '05 #4

P: n/a
----- DotNetJunkies User wrote: ----

Thanks.....msvcrtd.lib did the trick for my debug build too....I wonder what msvcrtd.lib stands for
MicroSoft Visual C RunTime Debug Library, most likely.
Nov 17 '05 #5

P: n/a
I hit a similar problem. I create a .NET Class Library called foofoo. It compiles and links fine.

Then I add
#include <vector>
to foofoo.cpp

It compiles fine, but when it links it gives many errors.

Does anyone have a workaround? I tried the suggestions on this page, but did not have any luck.
------ Build started: Project: foofoo, Configuration: Debug Win32 ------

Compiling...
foofoo.cpp
Linking...
foofoo.obj : error LNK2001: unresolved external symbol "void * __cdecl memcpy(void *,void const *,unsigned int)" (?memcpy@@$$J0YAPAXPAXPBXI@Z)
foofoo.obj : error LNK2001: unresolved external symbol "void * __cdecl memmove(void *,void const *,unsigned int)" (?memmove@@$$J0YAPAXPAXPBXI@Z)
foofoo.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
foofoo.obj : error LNK2001: unresolved external symbol "void __cdecl __CxxUnregisterExceptionObject(void *,int)" (?__CxxUnregisterExceptionObject@@$$J0YAXPAXH@Z)
foofoo.obj : error LNK2001: unresolved external symbol "void __stdcall _CxxThrowException(void *,struct _s__ThrowInfo const *)" (?_CxxThrowException@@$$J18YGXPAXPBU_s__ThrowInfo@ @@Z)
foofoo.obj : error LNK2001: unresolved external symbol "int __cdecl __CxxRegisterExceptionObject(void *,void *)" (?__CxxRegisterExceptionObject@@$$J0YAHPAX0@Z)
foofoo.obj : error LNK2001: unresolved external symbol "int __cdecl __CxxQueryExceptionSize(void)" (?__CxxQueryExceptionSize@@$$J0YAHXZ)
foofoo.obj : error LNK2001: unresolved external symbol "int __cdecl __CxxDetectRethrow(void *)" (?__CxxDetectRethrow@@$$J0YAHPAX@Z)
foofoo.obj : error LNK2001: unresolved external symbol "int __cdecl __CxxExceptionFilter(void *,void *,int,void *)" (?__CxxExceptionFilter@@$$J0YAHPAX0H0@Z)
libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
libcpmtd.lib(nomemory.obj) : error LNK2001: unresolved external symbol "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
libcpmtd.lib(string.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
libcpmtd.lib(nomemory.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
libcpmtd.lib(string.obj) : error LNK2019: unresolved external symbol ___CxxFrameHandler referenced in function __ehhandler$?_Xlen@_String_base@std@@QBEXXZ
libcpmtd.lib(string.obj) : error LNK2019: unresolved external symbol __except_list referenced in function "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
libcpmtd.lib(string.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) referenced in function $L12220
libcpmtd.lib(nomemory.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ)
libcpmtd.lib(string.obj) : error LNK2019: unresolved external symbol "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) referenced in function "public: __thiscall std::logic_error::logic_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0logic_error@std@@QAE@ABV?$basic_string@DU?$cha r_traits@D@std@@V?$allocator@D@2@@1@@Z)
libcpmtd.lib(string.obj) : error LNK2019: unresolved external symbol _strlen referenced in function "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z)
libcpmtd.lib(newop.obj) : error LNK2019: unresolved external symbol __callnewh referenced in function "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
libcpmtd.lib(newop.obj) : error LNK2019: unresolved external symbol _malloc referenced in function "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
libcpmtd.lib(nomemory.obj) : error LNK2019: unresolved external symbol _atexit referenced in function "void __cdecl std::_Nomemory(void)" (?_Nomemory@std@@YAXXZ)
libcpmtd.lib(nomemory.obj) : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall exception::what(void)const " (?what@exception@@UBEPBDXZ)
libcpmtd.lib(nomemory.obj) : error LNK2019: unresolved external symbol "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) referenced in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z)
LINK : error LNK2001: unresolved external symbol __load_config_used
C:\Documents and Settings\Jamie Cho\Desktop\foofoo\Debug\foofoo.dll : fatal error LNK1120: 22 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Jamie Cho\Desktop\foofoo\foofoo\Debug\BuildLog.htm"
foofoo - 26 error(s), 0 warning(s)
---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.