Windows 8 未找到Windows 8 metro应用程序标识符错误

Windows 8 未找到Windows 8 metro应用程序标识符错误,windows-8,c++-cx,Windows 8,C++ Cx,我在MainPage.xaml.h文件中声明了三个函数: int GetOperator(Platform::String^ str); bool IsNumber (Platform::String^ str); bool IsOperator (Platform::String^ str); 并在MainPage.cpp文件中使用它们,但在尝试构建时,在.cpp文件中的这三个函数上会出现“Identifier not found”错误 它们都由第四个函数调用,该函数也在my.h文件中声明,

我在MainPage.xaml.h文件中声明了三个函数:

int GetOperator(Platform::String^ str);
bool IsNumber (Platform::String^ str);
bool IsOperator (Platform::String^ str);
并在MainPage.cpp文件中使用它们,但在尝试构建时,在.cpp文件中的这三个函数上会出现“Identifier not found”错误


它们都由第四个函数调用,该函数也在my.h文件中声明,但我在第四个函数中没有发现此错误。

首先需要将头文件添加到cpp文件中(并且还需要在IDE中设置链接器,以便编译器知道头文件的位置)

之后,还需要在.cpp文件/代码中声明函数。这叫做远期申报。编译函数调用时,编译器需要知道函数原型

int GetOperator(Platform::String^ str);
bool IsNumber (Platform::String^ str);
bool IsOperator (Platform::String^ str);

int main()
{
   ...
   your code
   ...
}

仅供参考。Metro是德国的一个商标,这就是它被重命名为Windows应用商店应用程序的原因。只是作为一个小信息。啊,谢谢!请你详细说明你的答案,再加上对你提供的解决方案的描述,好吗?
int GetOperator(Platform::String^ str);
bool IsNumber (Platform::String^ str);
bool IsOperator (Platform::String^ str);

int main()
{
   ...
   your code
   ...
}