I'm relatively new to C++ and .NET and I am getting this error now in a Windows Forms project.
There seems to be some problem with the included headers and I was able to reproduce the error with a minimal example. I just don't have any idea how to work around it.
I have a class A like this. It is included in stdafx.h.
1 2 3 4 5 6 7 8 9 10
// A.h
#pragma once
#include "Form1.h"
ref class A
{
public:
A();
}
I need to access code from Form1 in A but I also need a member of type A in Form1 so included A.h in Form1 as well and the error points to where I define the member like this.