1
在项目.ino
文件工作的:的Eclipse IDE的Arduino(Sloeber)C++字符串类错误没有指定类型
void loop()
{
String stringOne = "Hello String";
}
然而,在一个类中我得到这些错误:
// MenuItem.h
//#include "String.h" ====> Makes no difference if not commented
class MenuItem {
public:
MenuItem();
private:
String stringTwo; ====> 'String' does not name a type
};
// MenuItem.cpp
//#include "String.h" ====> Makes no difference if not commented
MenuItem::MenuItem() {
stringTwo = "Goodbye String"; ===> 'stringTwo' was not declared in this scope
}
我已经尝试#include
与<>
而不是引号和不带.h.
不同的选项我完全困惑。谢谢。
#include“WString.h”位于定义变量的.h文件中。 – user7117046