Newb w/ simple wrapping ?

S

SteveK

Just trying to work through some examples I have seen on the web.... I'm
getting an unresolved external linker error for operator new and delete.

Here is the code, VERY simple.
#pragma once
using namespace System;


namespace AB_Wrapper
{
// unmanaged class
class CMyOldClass
{
public:
CMyOldClass(int i)
{
m_i = i;
}

int GetValue(){ return m_i; };

private:
int m_i;
};


// managed class
public __gc class Class1
{
public:
Class1()
{
m_pOldClass = new CMyOldClass(666);
}
int GetValue()
{
return m_pOldClass->GetValue();
}

private:
CMyOldClass* m_pOldClass;
};
}


anyone have any ideas?
 
G

Guest

Try linking with mfcs71.lib and mrcext.lib. One small request, it would be
always easier if you can post the error message too.

Thanks
Saran
 
S

SteveK

Thanks for the quick response, Saran!

adding "msvcrt.lib" to the input solved it. Makes sense...

Thanks again!
 

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