これは、Visual C ++Express2010で作業しているクラスのヘッダーです。
/* custom class header to communicate with LynxMotion robot arm */
#include <vector>
using namespace System;
using namespace System::IO::Ports;
public ref class LynxRobotArm
{
public:
LynxRobotArm();
~LynxRobotArm();
void connectToSerialPort(String^ portName, int baudRate);
void disconnectFromSerialPort();
void setCurrentPosition(int channel, int position);
int getCurrentPosition(int channel);
void moveToPosition(int channel, int position);
private:
void initConnection();
SerialPort^ serialPort;
array<String^> ^serialPortNames;
String^ portName;
int baudRate;
vector<int> currentPosition;
};
int currentPosition
最後の行をに変更するまで、すべてが正常に機能しましたvector<int> currentPosition
。今すぐコンパイル/デバッグしようとすると、次のエラーメッセージが表示されます。
error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2238: unexpected token(s) preceding ';'
これらのエラーコードの詳細についてMSDNを確認しましたが、コードの何が問題になっているのかわかりません。何か案は?