Packet Class

Hi, I've been working on this program but i keep getting a LNK2019 error

"Error 1 error LNK2019: unresolved external symbol "public: void __thiscall Packet::Transmit(void)" (?Transmit@Packet@@QAEXXZ) referenced in function _main"when trying to compile my code.
This only happens when I attempt to use the function transmit() to enqueue data into a queue. Here's my code for just the packet class. I've already tested my node and queue classes to make sure they worked.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once
#include "node.h"
#include "Queue.h"

class Packet
{
	int incOddEven;
	

public:
	Packet();
	void Transmit(void);
	void Recieve(Queue);



};



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
#include <iostream>
using namespace std;
#include "Queue.h"
#include "node.h"
#include "Packet.h"

 Packet::Packet()
{
	 incOddEven=0;
	
}
void Transmit(void)
{
	Queue myqueue;

	Node *n0 = new Node(0);
	Node *n1 = new Node(1);
	Node *n2 = new Node(0);
	Node *n3 = new Node(0);
	Node *n4 = new Node(1);
	Node *n5 = new Node(0);
	Node *n6 = new Node(1);
	Node *n7 = new Node(1);
	myqueue.enQueue(n0);
	myqueue.enQueue(n1);
	myqueue.enQueue(n2);
	myqueue.enQueue(n3);
	myqueue.enQueue(n4);
	myqueue.enQueue(n5);
	myqueue.enQueue(n6);
	myqueue.enQueue(n7);
	
	//return myqueue;
}
void Packet::Recieve(Queue Information)
{


}



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <conio.h>
#include <iostream>
using namespace std;
#include "node.h"
#include "Queue.h"
#include "Packet.h"
int main()
{
	Queue myqueue;
	Packet test;
	
	test.Transmit();




	while (!_kbhit());
	return 0;
}

Last edited on
Found my error. Transmit() isn't part of my packet class. Needed to use Packet::Transmit(){}
Topic archived. No new replies allowed.