I'm a beginner at programming, know my way around with Java but I'm currently having quite some trouble with C++. I'm getting the following error: Unresolved External Symbol, when I try to do this in a function of a different class:
player1 = new Character(50, 300, linep1);
Error:
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl Character::Character(int,int,class QLine *)" (??0Character@@QEAA@HHPEAVQLine@@@Z) referenced in function "public: void __cdecl MainWindow::setUpPlayers(void)" (?setUpPlayers@MainWindow@@QEAAXXZ)
My Character header file looks like this:
#include <QLine>
class Character
{
public:
Character(int xCoor, int yCoor, QLine *line);
QLine getView();
int getX();
int getY();
int getScore();
private:
QLine *view;
const int x;
int y;
int score;
};
The upper part of my cpp file looks like this:
#include "character.h"
Character::Character(int xCoor, int yCoor, QLine *line)
{
score = 0;
x = xCoor;
y = yCoor;
view = line;
}
As you can see I'm currently working with Qt as well. Could anyone help me out with this? Much appreciated!