Unresolved externals when using STL in a .NET class library

  • Thread starter Thread starter Steve Terepin
  • Start date Start date
S

Steve Terepin

Do I need to include some extra libraries when I use the STL <string>
classes ? I've created a new Class Library (.NET) project, added a #include
<string> directive to the main .cpp file, and created an instance of a
std::string ; this compiles fine, but the linker reports two unresolved
symbols - '_CxxThrowException' and 'delete'. Any ideas ?
 
I'm getting the very same behavior for my MC++ dll project. I've tried
including a hole bunch of includes in the stdafx.h file:

#include <windows.h>
#include <string.h>
#include <malloc.h>
#include <memory.h>
#include <iostream>
#include <tchar.h>
#include <stdlib.h>

with no success. What do I need to include in order for it to link up?

Thanks.
Jon Lea
 
you need to link to one of the C runtime libraries.
--------------------
Subject: Re: Unresolved externals when using STL in a .NET class library
Date: Mon, 29 Sep 2003 12:13:16 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vc
NNTP-Posting-Host: h-66-166-201-170.snvacaid.covad.net 66.166.201.170
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:28864
X-Tomcat-NG: microsoft.public.dotnet.languages.vc

I'm getting the very same behavior for my MC++ dll project. I've tried
including a hole bunch of includes in the stdafx.h file:

#include <windows.h>
#include <string.h>
#include <malloc.h>
#include <memory.h>
#include <iostream>
#include <tchar.h>
#include <stdlib.h>

with no success. What do I need to include in order for it to link up?

Thanks.
Jon Lea
 
Back
Top