1 #include"unmanaged.h"
2 #include"stdafx.h"
3 using namespace std;
4 _gc class Mclass
5 {
6 private:
7 string Mx;
8 cppclass * obj;
9 public:
10 Mclass();
11 ~Mclass();
12 string native();
13 };
when buliding this throws
error C4430: missing type specifier – int assumed.
Note: C++ does not support default-int and
error C2143: syntax error : missing ‘;’ before ‘
the content of unmanged.h is
#include"stdafx.h"
#include<string>
#include<iostream>
using namespace std;
class cppclass
{
private:
string x;
public:
cppclass();
~cppclass();
string native();
};
You need two underscores in
__gc. See msdn.