0
我在Form1
中有一个名为AUTO
的变量,我想以名为RoomStack
的形式使用它。使用不同形式的变量
我RoomStack.h
声明如下:
static Form1 ^FM = gcnew Form1();
(所以后来我就喜欢写东西FM->AUTO
)
但声明是给错误:
error C2143: syntax error : missing ';' before '^'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C3845: 'myUI::RoomStack::FM': only static data members can be initialized inside a ref class or value type
请注意,我遇到这个问题之前和相同的方法工作。 我有一个名为NewGame
形式,它包含了一个变量,我想在Form1
使用,所以在Form1.h
我宣布:
static NewGame ^NG = gcnew NewGame();
,它编译。
为什么我现在有错误?