unresolved external

I have this script which can read code written with molecules (like DNA) but i am getting an error on my operator class, which is supposed to handle all math of the dna code.

here is the error log:
Error 1 error LNK2019: unresolved external symbol "public: float __thiscall Integer::GetInteger(class Molekule)" (?GetInteger@Integer@@QAEMVMolekule@@@Z) referenced in function "public: float __thiscall Operator::DoOperator(class Molekule,class Molekule,class Molekule,class Chromosome)" (?DoOperator@Operator@@QAEMVMolekule@@00VChromosome@@@Z) I:\Creepie Crawlers\Creepie Crawlers\Operator.obj Creepie Crawlers


1
2
3
4
5
6
7
8
9
10
11
#pragma once
#include "Crawler.h"
class Operator
{
public:
	Operator(Crawlers crawler);
	bool CheckIfOperator(string moleculeSymbol);
	float DoOperator(Molekule op, Molekule in, Molekule inte, Chromosome chromosome);
private:
	Crawlers _crawler;
};

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "Operator.h"
#include "Integer.h"

Operator::Operator(Crawlers crawler)
{
	crawler = _crawler;
}


bool Operator::CheckIfOperator(string moleculeSymbol){
	if (moleculeSymbol == "P" || moleculeSymbol == "Q" || moleculeSymbol == "R" || moleculeSymbol == "S" || moleculeSymbol == "U" || moleculeSymbol == "X" || moleculeSymbol == "Y"){
		return true;
	}
	return false;

	
	
}

float Operator::DoOperator(Molekule op, Molekule in, Molekule inte, Chromosome chromosome){
	Integer x;
	Input y("test");
	
	if (!x.CheckIfInteger(inte.getSymbol())){
		return 0;
	}
	if (!y.CheckIfInput(chromosome, in.getSymbol())){
		return 0;
	}
	if (op.getSymbol() == "P"){
		return _crawler.getInput(in) + x.GetInteger(inte);
	}
	if (op.getSymbol() == "Q"){
		return _crawler.getInput(in) - x.GetInteger(inte);
	}
	if (op.getSymbol() == "R"){
		return _crawler.getInput(in) * x.GetInteger(inte);
	}
	if (op.getSymbol() == "S"){
		return _crawler.getInput(in) / x.GetInteger(inte);
	}
	if (op.getSymbol() == "Y"){
		if (_crawler.getInput(in) != x.GetInteger(inte)){
			return _crawler.getInput(in);
		}
	}
	if (op.getSymbol() == "U"){
		if (_crawler.getInput(in) == x.GetInteger(inte)){
			return _crawler.getInput(in);
		}
	}
	if (op.getSymbol() == "X"){
		return x.GetInteger(inte);
	}
	return 0;
} 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include "Crawler.h"
#include "Input.h"
#include "Output.h"
#include "Integer.h"
#include "Operator.h"
class DNA_Reading
{
public:
	DNA_Reading();
	void Scan(DNA code);
	void setCrawler(Crawlers crawler);
private:
	vector<Molekule> _outputs;
	vector<Molekule> _inputs;
	vector<Molekule> _integers;
	vector<Molekule> _operators;
	Crawlers _crawler;
};

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "DNA_Reading.h"


DNA_Reading::DNA_Reading()
{

}

void DNA_Reading::Scan(DNA code){
	Integer inte;
	Operator op(_crawler);
	Output out(_crawler);
	Input in("rand");
	
	for (signed int i = 0; i < code.getChromosomes().size(); i++){
		
		for (signed int a = 0; a < code.getChromosomes()[i].getGenes().size(); a++){
			
			for (signed int b = 0; b < code.getChromosomes()[i].getGenes()[a].getPairs().size(); b++){
				for (signed int c = 0; c < 2; c++){
					if (inte.CheckIfInteger(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c].getName())){
							_integers.push_back(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c]);
						}
					if (in.CheckIfInput(code.getChromosomes()[i], code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c].getName())){
						_inputs.push_back(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c]);
						}
					if (out.CheckIfOutput(code.getChromosomes()[i], code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c].getName())){
						_outputs.push_back(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c]);
						}
					if (op.CheckIfOperator(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c].getName())){
						_operators.push_back(code.getChromosomes()[i].getGenes()[a].getPairs()[b].getMolekules()[c]);
						}
				}
				
			}

		}
		out.DoOutput(_outputs[0], code.getChromosomes()[i], op.DoOperator(_operators[0], _inputs[0], _integers[0], code.getChromosomes()[i]));
		out.DoOutput(_outputs[1], code.getChromosomes()[i], op.DoOperator(_operators[0], _inputs[1], _integers[0], code.getChromosomes()[i]));
		
	}

	
}

void DNA_Reading::setCrawler(Crawlers crawler){
	_crawler = crawler;
}


Last edited on
As it says, you do not include Integer::getInteger() in your program. Do you compile file containing it?
LOL, thanks! I kept looking at doOperator and didnt see that i forgot the Integer:: before getInteger().
Topic archived. No new replies allowed.