hi i get this error ppl.cpp:7:1: error: prototype for 'ppl::ppl()' does not match any in class 'ppl'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
//main.cpp
#include "ppl.h"
#include "bday.h"
#include <iostream>
using namespace std;
int main()
{
bday boj(5,17,1990);
ppl nameOj("kavinda", boj);
nameOj.printInfo();
return 0;
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
//bday.h
#ifndef BDAY_H
#define BDAY_H
class bday {
public:
bday(int m, int d, int y);
void printDate();
private:
int month;
int day;
int year;
};
#endif
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
//bday.cpp
#include "bday.h"
#include <iostream>
using namespace std;
bday::bday(int m, int d, int y) {
month = m;
day = d;
year = y;
}
void bday::printDate(){
cout<<day<<"/"<<month<<"/"<<year<<endl;
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
//ppl.h
#include <string>
#include "bday.h"
#ifndef PPL_H
#define PPL_H
using namespace std;
class ppl {
public:
ppl(string x, bday bo);
void printInfo();
private:
string name;
bday dob;
};
#endif /* PPL_H */
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
//ppl.cpp
#include <iostream>
#include "ppl.h"
#include "bday.h"
using namespace std;
ppl::ppl()
:name(x), dob(bo)
{
}
void ppl::printInfo()
{
cout<< name <<" was born on ";
dob.printDate();
}
|
error log
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/listner/Documents/NetBeansProjects/z 1.9'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/z_1.9.exe
make[2]: Entering directory '/cygdrive/c/Users/listner/Documents/NetBeansProjects/z 1.9'
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f "build/Debug/Cygwin_4.x-Windows/bday.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/Cygwin_4.x-Windows/bday.o.d" -o build/Debug/Cygwin_4.x-Windows/bday.o bday.cpp
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f "build/Debug/Cygwin_4.x-Windows/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/Cygwin_4.x-Windows/main.o.d" -o build/Debug/Cygwin_4.x-Windows/main.o main.cpp
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f "build/Debug/Cygwin_4.x-Windows/ppl.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/Cygwin_4.x-Windows/ppl.o.d" -o build/Debug/Cygwin_4.x-Windows/ppl.o ppl.cpp
ppl.cpp:7:1: error: prototype for 'ppl::ppl()' does not match any in class 'ppl'
ppl::ppl()
^
In file included from ppl.cpp:2:0:
ppl.h:7:7: error: candidates are: ppl::ppl(const ppl&)
class ppl {
^
ppl.h:9:5: error: ppl::ppl(std::string, bday)
ppl(string x, bday bo);
^
nbproject/Makefile-Debug.mk:78: recipe for target 'build/Debug/Cygwin_4.x-Windows/ppl.o' failed
make[2]: *** [build/Debug/Cygwin_4.x-Windows/ppl.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/listner/Documents/NetBeansProjects/z 1.9'
nbproject/Makefile-Debug.mk:61: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/listner/Documents/NetBeansProjects/z 1.9'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)