【发布时间】:2014-12-05 21:40:29
【问题描述】:
这是我的错误
"/Library/Developer/CommandLineTools/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf "/Library/Developer/CommandLineTools/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/practice3 make[2]: * 没有规则来制作目标
newClass.cpp', needed bybuild/Debug/GNU-MacOSX/newClass.o'。停止。 make[1]: * [.build-conf] 错误 2 make: *** [.build-impl] 错误 2
在制作这个程序前几分钟,我偶然创建了一个名为 newClass 的课程,但后来我删除了它,我在我的计算机 (mac) 上根本找不到它。
这是我的程序,如果它完全造成此错误消息,我认为它根本不应该这样做,因为它根本没有调用 newClass 类。
main.cpp
#include <iostream>
#include "Birthday.h"
#include "People.h"
using namespace std;
int main() {
Birthday birthObj(1,28,2000);
People sebA("Sebastian A", birthObj);
sebA.printInfo();
}
Birthday.h
#ifndef BIRTHDAY_H
#define BIRTHDAY_H
using namespace std;
class Birthday {
public:
Birthday(int m, int d, int y);
void printDate();
private:
int month;
int day;
int year;
};
#endif
Birthday.cpp
#include "Birthday.h"
#include <iostream>
using namespace std;
Birthday::Birthday(int m, int d, int y) {
month = m;
day = d;
year = y;
}
void Birthday::printDate() {
cout << day << "/" << month << "/" << year << endl;
}
People.h
#ifndef PEOPLE_H
#define PEOPLE_H
#include <string>
#include "Birthday.h"
using namespace std;
class People {
public:
People(string x, Birthday bo);
void printInfo();
private:
string name;
Birthday dateOfBirth; // dateOfBirth is an object
};
#endif
People.cpp
#include <iostream>
#include "Birthday.h"
#include "People.h"
using namespace std;
People::People(string x, Birthday bo)
: name(x), dateOfBirth(bo)
{
}
void People::printInfo(){
cout << name << " was born on ";
dateOfBirth.printDate();
}
【问题讨论】:
-
这是一个生成文件问题。你是 c++ 对我们没用。
-
啊好吧,你要我补充什么?
-
不知道,Netbeans 的某种配置,但我不使用 Netbeans。
-
哦,对了,我去看看Netbeans的选项,谢谢:)
-
我找不到它,如果其他人可以帮助我。我将不胜感激:)
标签: c++ ios macos class netbeans