【发布时间】:2017-02-11 23:14:42
【问题描述】:
每次我尝试在 c++ 中编译一个类时,都会出现这个错误:
||=== 构建文件:“无项目”中的“无目标”(编译器:未知)===|
这是我的 Classes 类的代码:
#include <iostream>
#include "Cat.h"
using namespace std;
int main() {
Cat cat1;
cat1.speak();
cat1.jump();
return 0;
}
这是我的标头 Cat.h 的代码:
#ifndef CAT_H_
#define CAT_H_
class Cat {
public:
void speak();
void jump();
};
#endif /* CAT_H_ */
这是我的猫类的代码:
#include <iostream>
#include "Cat.h"
using namespace std;
void Cat::speak() {
cout << "Meouwww!!!" << endl;
}
void Cat::jump() {
cout << "Jumping to top of bookcase" << endl;
}
【问题讨论】:
-
您应该了解一下您正在使用的 IDE,或者运行一些教程。
标签: c++ compiler-errors codeblocks