M
Maxwell
Hello,
I having having oodles of trouble using the std lib in my MC++ (VS.NET
2003) Class library. I figured out a simple sample to reproduce the
errors I am having. Create a MC++ (VS.NET 2003) class library and type
in the following code below:
#include <map>
#include<string>
using std::string;
using std::map;
using namespace System;
using namespace std;
namespace ManagedLib
{
public __gc class Class1
{
public:
Class1(){};
~Class1(){};
void DoNativeHashMap()
{
std::map<std::string,std::string> x;
return;
}
};
};
when I go to complie this I get the following errors:
Linking...
LINK : error LNK2020: unresolved token (0A000008) ??_7type_info@@6B@
LINK : error LNK2020: unresolved token (0A000009) _CxxThrowException
LINK : error LNK2020: unresolved token (0A00000A) exception.__ctor
LINK : error LNK2020: unresolved token (0A00000C) exception.__dtor
LINK : error LNK2020: unresolved token (0A00000E) delete
LINK : fatal error LNK1120: 5 unresolved externals
Ok so I figured this must have something to do with std::map because
when I just have std::string everything is beautiful.
So I add a reference to msvcrtd.lib (for debug config) and msvcrt.lib
(for release config) thinking that would do the trick then the errors
go awy but I then get this warning (not error):
ibcpmtd.lib(xlock.obj) : warning LNK4210: .CRT section exists; there
may be unhandled static initializers or terminators
I looked on the msdn site and found something about Converting Managed
Extensions for C++ Projects from Pure Intermediate Language to Mixed
Mode ->
http://msdn.microsoft.com/library/d...tsFromPureIntermediateLanguageToMixedMode.asp
I just can't imagine this is what one would have to do to use teh
std::map or std::set in a MC++ class library...
Can someonw confirm this...Please say it aint so
Help help would definitely be appretiated..
Regards
Max
I having having oodles of trouble using the std lib in my MC++ (VS.NET
2003) Class library. I figured out a simple sample to reproduce the
errors I am having. Create a MC++ (VS.NET 2003) class library and type
in the following code below:
#include <map>
#include<string>
using std::string;
using std::map;
using namespace System;
using namespace std;
namespace ManagedLib
{
public __gc class Class1
{
public:
Class1(){};
~Class1(){};
void DoNativeHashMap()
{
std::map<std::string,std::string> x;
return;
}
};
};
when I go to complie this I get the following errors:
Linking...
LINK : error LNK2020: unresolved token (0A000008) ??_7type_info@@6B@
LINK : error LNK2020: unresolved token (0A000009) _CxxThrowException
LINK : error LNK2020: unresolved token (0A00000A) exception.__ctor
LINK : error LNK2020: unresolved token (0A00000C) exception.__dtor
LINK : error LNK2020: unresolved token (0A00000E) delete
LINK : fatal error LNK1120: 5 unresolved externals
Ok so I figured this must have something to do with std::map because
when I just have std::string everything is beautiful.
So I add a reference to msvcrtd.lib (for debug config) and msvcrt.lib
(for release config) thinking that would do the trick then the errors
go awy but I then get this warning (not error):
ibcpmtd.lib(xlock.obj) : warning LNK4210: .CRT section exists; there
may be unhandled static initializers or terminators
I looked on the msdn site and found something about Converting Managed
Extensions for C++ Projects from Pure Intermediate Language to Mixed
Mode ->
http://msdn.microsoft.com/library/d...tsFromPureIntermediateLanguageToMixedMode.asp
I just can't imagine this is what one would have to do to use teh
std::map or std::set in a MC++ class library...
Can someonw confirm this...Please say it aint so
Help help would definitely be appretiated..
Regards
Max