Oct 10, 2011 at 10:16am UTC
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1'
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/204assignment1.exe
make[2]: Entering directory `/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1'
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/PointTwoD.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/PointTwoD.o.d -o build/Debug/Cygwin-Windows/PointTwoD.o PointTwoD.cpp
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/LocationData.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/LocationData.o.d -o build/Debug/Cygwin-Windows/LocationData.o LocationData.cpp
LocationData.cpp:71:2: warning: no newline at end of file
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/MissionPlan.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/MissionPlan.o.d -o build/Debug/Cygwin-Windows/MissionPlan.o MissionPlan.cpp
MissionPlan.cpp:111:2: warning: no newline at end of file
mkdir -p dist/Debug/Cygwin-Windows
g++ -o dist/Debug/Cygwin-Windows/204assignment1 build/Debug/Cygwin-Windows/PointTwoD.o build/Debug/Cygwin-Windows/LocationData.o build/Debug/Cygwin-Windows/MissionPlan.o
build/Debug/Cygwin-Windows/LocationData.o: In function `_ZN12LocationDataC2Ev':
/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1/LocationData.cpp:12: undefined reference to `vtable for LocationData'
build/Debug/Cygwin-Windows/LocationData.o: In function `_ZN12LocationDataC1Ev':
/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1/LocationData.cpp:12: undefined reference to `vtable for LocationData'
build/Debug/Cygwin-Windows/LocationData.o: In function `_ZN12LocationDataC2ESsiiff':
/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1/LocationData.cpp:20: undefined reference to `vtable for LocationData'
build/Debug/Cygwin-Windows/LocationData.o: In function `_ZN12LocationDataC1ESsiiff':
/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1/LocationData.cpp:20: undefined reference to `vtable for LocationData'
build/Debug/Cygwin-Windows/MissionPlan.o: In function `_Z41__static_initialization_and_destruction_0ii':
/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1/MissionPlan.cpp:13: undefined reference to `LocationData::~LocationData()'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin-Windows/204assignment1.exe] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Asus/Documents/NetBeansProjects/204Assignment1'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 6s)
can anyone tell me what is this error?
Oct 10, 2011 at 10:37am UTC
can u post the code or about what the program belongs to???????
Oct 10, 2011 at 10:56am UTC
this is my coding... it is a bit long..
mission.cpp
#include <cstdlib>
#include <iostream>
#include <cctype>
#include <cstring>
#include <sstream>
#include <fstream>
#include "LocationData.h"
#include "PointTwoD.h"
using namespace std;
PointTwoD p2d;
LocationData ld;
void menu();
void Entry();
int main(int argc, char** argv) {
menu();
}
void menu() {
int input;
cout << "****************************************************" << endl;
cout << "Welcome to Mission Plan Program" << endl;
cout << "1) Input statistic data" << endl;
cout << "2) Compute civ. index value (for all records)" << endl;
cout << "3) Print top 5 exploration destinations" << endl;
cout << "4) Print total travel distance" << endl;
cout << "5) Exit" << endl;
cout << "****************************************************" << endl << endl;
cout << "Please enter your choice:";
cin >> input;
switch (input) {
case 1:
Entry();
system("clear");
menu();
break;
case 2:
system("clear");
menu();
break;
case 3:
system("clear");
menu();
break;
case 4:
system("clear");
menu();
break;
case 5:
exit(0);
}
}
void Entry() {
int x, y, noPlanets, noMoons;
string sunType;
float aveParticulateDensity, avePlasmaDensity;
string data;
cout << "[Input statistical data]" << endl;
cout << "Please enter x-orinate: ";
cin.clear();
getline(cin, data);
x = atoi(data.c_str());
cout << "Please enter y-orinate: ";
cin.clear();
getline(cin, data);
y = atoi(data.c_str());
cout << "Please enter Sun-type: ";
cin.clear();
getline(cin, data);
sunType = data;
cout << "Please enter no of earth-like planet: ";
cin.clear();
getline(cin, data);
noPlanets = atoi(data.c_str());
cout << "Please enter no of earth-like moon: ";
cin.clear();
getline(cin, data);
noMoons = atoi(data.c_str());
cout << "Please enter ave. particulate density (%-tage) : ";
cin.clear();
getline(cin, data);
aveParticulateDensity = atof(data.c_str());
cout << "Please enter ave. plasma density (%-tage) : ";
cin.clear();
getline(cin, data);
avePlasmaDensity = atof(data.c_str());
}
Oct 10, 2011 at 10:57am UTC
LocationData.cpp
#include "LocationData.h"
#include <cctype>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstring>
#include <cstring>
#include <cstdlib>
using namespace std;
LocationData::LocationData() {
sunType = "";
noPlanets = 0;
noMoons = 0;
aveParticulateDensity = 0.0;
avePlasmaDensity = 0.0;
}
LocationData::LocationData(string sunType, int noPlanets, int noMoons, float aveParticulateDensity, float avePlasmaDensity) {
this-> sunType = sunType;
this-> noPlanets = noPlanets;
this-> noMoons = noMoons;
this-> aveParticulateDensity = aveParticulateDensity;
this-> avePlasmaDensity = avePlasmaDensity;
}
string LocationData::getSunType() {
return sunType;
}
void LocationData::setSunType(string sunType) {
this -> sunType = sunType;
}
int LocationData::getNoPlanets() {
return noPlanets;
}
void LocationData::setNoPlanets(int noPlanets) {
this->noPlanets = noPlanets;
}
int LocationData::getNoMoons() {
return noMoons;
}
void LocationData::setNoMoons(int noMoons) {
this -> noMoons = noMoons;
}
float LocationData::getAveParticulateDensity() {
return aveParticulateDensity;
}
void LocationData::setAveParticulateDensity(float aveParticulateDensity) {
this -> aveParticulateDensity = aveParticulateDensity;
}
float LocationData::getAvePlasmaDensity() {
return avePlasmaDensity;
}
void LocationData::setAvePlasmaDensity(float avePlasmaDensity) {
this -> avePlasmaDensity = avePlasmaDensity;
}
string LocationData::toString() {
}
Oct 10, 2011 at 10:57am UTC
LocationData.h
#ifndef _LOCATIONDATA_H
#define _LOCATIONDATA_H
#include <cstring>
#include <iostream>
using namespace std;
class LocationData {
public:
LocationData();
LocationData(string, int, int, float, float);
// LocationData(const LocationData& orig);
virtual ~LocationData();
string getSunType();
void setSunType(string);
int getNoPlanets();
void setNoPlanets(int);
int getNoMoons();
void setNoMoons(int);
float getAveParticulateDensity();
void setAveParticulateDensity(float);
float getAvePlasmaDensity();
void setAvePlasmaDensity(float);
string toString();
private:
string sunType;
int noPlanets;
int noMoons;
float aveParticulateDensity;
float avePlasmaDensity;
};
#endif /* _LOCATIONDATA_H */
i will get this error when my code is like this.. anyway thanks for spending your time to take a look at my code.
Last edited on Oct 10, 2011 at 10:59am UTC
Oct 10, 2011 at 11:00am UTC
You forgot to implement the destructor (like the errors says)
Oct 10, 2011 at 11:54am UTC
[co de]This[/code] becomes This
Oct 11, 2011 at 2:44am UTC
erm im kinda new to c++... cause i self learn c++ myself through the web.. mine explaining to me what is destructor and how should i edit my code to make it no error?
thanks in advance
Oct 12, 2011 at 8:36am UTC
omg.. thanks for your help....