I'm encountering these errors:
1>...\inventory.h(9): error C2143: syntax error: missing ';' before '*'
1>...\inventory.h(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>...\inventory.h(9): error C2238: unexpected token(s) preceding ';'
1>...\inventory.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>...\inventory.h(15): error C2143: syntax error: missing ',' before '&'
When trying to compile the following code.
Inventory.h
#pragma once
#include "Includes.h"
class Inventory
{
private:
int inv_cap;
int inv_nrOfItems;
Item **inv_itemArr;
void expand();
void initialize(const int from);
public:
Inventory();
virtual ~Inventory();
void addItem(const Item &inv_item);
void removeItem(int index);
};
Includes.h
#pragma once
#include <iostream>
#include <iomanip>
#include <string>
#include <ctime>
#include "Functions.h"
#include "Character.h"
#include "Item.h"
#include "Inventory.h"
using namespace std;
Item.h
#pragma once
#include "Includes.h"
class Item
{
private:
std::string i_name;
int i_buyValue;
int i_sellValue;
public:
Item();
virtual ~Item();
inline void debugPrint() const
{
std::cout << i_name << std::endl;
}
};
Based on the googling I've done, my problems seems to have to do with forward declaration, but I'm in the dark as how to fix it.