请看下面的头文件
#pragma once
using namespace UsbLibrary;
ref class MissileLauncher
{
public:
MissileLauncher(void);
private:
//Bytes used in command
unsigned char UP[10];
unsigned char RIGHT[10];
unsigned char LEFT[10];
unsigned char DOWN[10];
unsigned char FIRE[10];
unsigned char STOP[10];
unsigned char LED_OFF[9];
unsigned char LED_ON[9];
UsbHidPort USB;
};
我在 Visual Studio Professional 2010 中使用 Visual C++ 项目(C++/CLI?)。运行此代码时,出现很多错误
Error 1 error C4368: cannot define 'UP' as a member of managed 'MissileLauncher': mixed types are not supported
Error 2 error C4368: cannot define 'RIGHT' as a member of managed 'MissileLauncher': mixed types are not supported
Error 3 error C4368: cannot define 'LEFT' as a member of managed 'MissileLauncher': mixed types are not supported
Error 4 error C4368: cannot define 'DOWN' as a member of managed 'MissileLauncher': mixed types are not supported
Error 5 error C4368: cannot define 'FIRE' as a member of managed 'MissileLauncher': mixed types are not supported
Error 6 error C4368: cannot define 'STOP' as a member of managed 'MissileLauncher': mixed types are not supported
Error 7 error C4368: cannot define 'LED_OFF' as a member of managed 'MissileLauncher': mixed types are not supported
Error 8 error C4368: cannot define 'LED_ON' as a member of managed 'MissileLauncher': mixed types are not supported
在这里,命名空间USBLibrary
来自 C# dll 文件。UsbHidPort;
是来自该 C# dll 的对象
那么,为什么我会收到此错误?有任何想法吗?