0

please, can someone help me on my assignment? It's an very basic program to learn how to use Multiple Inherritance.

the errors I get are:

Error   1   error LNK2019: unresolved external symbol "public: void __thiscall Wasmachine::wassen(void)" (?wassen@Wasmachine@@QAEXXZ) referenced in function "public: void __thiscall Automaat::start(void)" (?start@Automaat@@QAEXXZ)  C:\Users\Gebruiker\Documents\Visual Studio 2013\Projects\C++ Eindopdracht\C++ Eindopdracht\Automaat.obj C++ Eindopdracht
Error   2   error LNK2019: unresolved external symbol "public: void __thiscall Centrifuge::centrifugeren(void)" (?centrifugeren@Centrifuge@@QAEXXZ) referenced in function "public: void __thiscall Automaat::start(void)" (?start@Automaat@@QAEXXZ)    C:\Users\Gebruiker\Documents\Visual Studio 2013\Projects\C++ Eindopdracht\C++ Eindopdracht\Automaat.obj C++ Eindopdracht
Error   3   error LNK1120: 2 unresolved externals   C:\Users\Gebruiker\Documents\Visual Studio 2013\Projects\C++ Eindopdracht\Debug\C++ Eindopdracht.exe    1   1   C++ Eindopdracht

Automaat.h:

#ifndef AUTOMAAT_H
#define AUTOMAAT_H

#include "Wasmachine.h"
#include "Centrifuge.h"

class Automaat : public Wasmachine, public Centrifuge {
public:
    void start();
};

#endif

Wasmachine.h:

#ifndef WASMACHINE_H
#define WASMACHINE_H

#include "cfunctions.h"

class Wasmachine {
public:
    Wasmachine() { //constructor
        char machine[24][31] = { // some information I want to display };

        for (int m = 0; m<24; m++){
            gotoxy(29, 5 + m);
            cout << machine[m];
        }
    }

    ~Wasmachine() {
        normale_cursor();
    }

    void wassen();
};

#endif

centrifuge.h:

#ifndef CENTRIFUGE_H
#define CENTRIFUGE_H

class Centrifuge {
public:
    void centrifugeren();                       
};

#endif

Automaat.cpp:

#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;

#include "Automaat.h"

void Automaat::start(){
    char ch = getc(stdin);
    if (ch == 's' || ch == 'S') {
        wassen(); // from "Wasmachine.h"
        centrifugeren(); // from "Centrifuge.h"
    }
}

void main() {
    Automaat a;
    a.start();
}

Thank you in advance!

Job Douma
  • 9
  • 1
  • 1
    Have you defined those two functions, `Wasmachine::wassen()` and `Centrifuge::centrifugeren()`? If so, are you compiling and linking the source files containing those definitions, as well as `Automaat.cpp`? – Mike Seymour Apr 16 '15 at 16:58
  • 1
    Welcome to SO! You should ask more specific questions here and not "what is wrong?". Please take a look here: http://stackoverflow.com/help/how-to-ask – NatureShade Apr 16 '15 at 17:00
  • Thanks guys and especially Mike! I had to define those two functions. – Job Douma Apr 16 '15 at 17:48

0 Answers0