About LNK2001 in VC++ 2003

I

Irakli Lomidze

Dear Sirs plz Help me

I'm Trying compile in C++ .NET 2003 (VS 2003 Enterprise Arcitech)
This Code (From MSDN) And Gives LNK2001 Linker Error
When i remove "new" operator form constructor all works fine
plz help me what happand and how slove this problem
This code has no problem in vc++2002

class CppClass
{
public:
// constructor
CppClass() {}
// destructor
~CppClass() {}
// methods
void native_f() {}
};

__gc class MClass
{
public:
// constructor
MClass() { m_pC = new CppClass(); }
// destructor
~MClass() { delete m_pC; }
// method
void managed_f() { m_pC->native_f(); }
private:
CppClass __nogc * m_pC;
};
 
P

Pranish Kumar [VC++ MSFT]

--------------------
From: "Irakli Lomidze" <[email protected]>
Subject: About LNK2001 in VC++ 2003

Dear Sirs plz Help me

I'm Trying compile in C++ .NET 2003 (VS 2003 Enterprise Arcitech)
This Code (From MSDN) And Gives LNK2001 Linker Error
When i remove "new" operator form constructor all works fine
plz help me what happand and how slove this problem
This code has no problem in vc++2002

I tried the code provided and did not encounter any problems, could you
provide your usage scenario or other information that might indicate what
the error is. I used a MC++ console application for my project.

Pranish Kumar, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top