Unknown size of vector

Apr 3, 2015 at 5:50pm
Hi,

I have an application that require the use of OO using vectors. I am pretty new to classes so it is probably a simple a mistake but I cannot figure out what is wrong.

I am getting an error which says Error 1 error C2036: 'Row *' : unknown size c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1307

This is the code for the rows class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

class Berths; // forward delcaration  

#include "Berths.h"
#include "Ship.h"
#include <iostream>
#include <vector>

class Rows
{
public:
	Rows(void);
	~Rows(void);

	std::vector<Berths> berth_Storage;

	bool dock(Ship ship);

	bool undock(Ship ship);

};


This is the code for the docks class.
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
#pragma once
#include <vector>
#include "Rows.h"
#include "Ship.h"
#include <iostream>
class Row;
class Berths;

class Dock1
{
public:
	Dock1(void);
	~Dock1(void);



public:
	std::vector<Row> rows;
	
	void size() const;

	Rows* dock(Ship ship);

	Rows* undock(Ship ship);


};



I thought as a vector doesn't need a size it is initialized correctly.

Can anyone shed some light as to why this error is occurring?

Thanks
Apr 3, 2015 at 5:56pm
Its becuase in you have Berth included in Rows, and Rows included in Berths, the files gets all fucked up. Just what I told you on your last thread. You need to think of a new design.
Topic archived. No new replies allowed.