這是我的錯誤錯誤有關的一類我甚至不具有
「/庫/開發商/ CommandLineTools在/ usr/bin中/使」 -f nbproject文件/ Makefile-Debug.mk QMAKE =子項目= * .build-conf */Library/Developer/CommandLineTools/usr/bin/make「-f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/practice3 make [2]:*構建/調試/ GNU-MacOSX/newClass.o'。停止。 化妝[1]:* [.build設置]錯誤2 化妝:*** [.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();
}
它是一個makefile問題。你是C++對我們毫無用處。 – IdeaHat 2014-10-10 16:43:16
好的,你想要我補充什麼? – 2014-10-10 16:49:34
不知道,與Netbeans的某種配置,但我不使用Netbeans。 – IdeaHat 2014-10-10 16:50:59