Groups | Blog | Home
all groups > visual c > september 2003 >

visual c : About LNK2001 in VC++ 2003


Irakli Lomidze
9/30/2003 12:41:44 AM
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;
};


pranishk NO[at]SPAM microsoft.com (
10/3/2003 6:33:34 PM

--------------------
[quoted text, click to view]

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
AddThis Social Bookmark Button