- #1
yungman
- 5,719
- 242
- TL;DR Summary
- I get Building error that I looked online following the error code and compare the code to the book, I cannot figure what I did wrong.
This is a very simple program about Class with Inventory.h, Inventory.cpp and source.cpp. I reduced to very simple just displaying two message and it just won't build. It gave me error message I don't follow even after reading the error code online. I follow the example and syntax from the book. I am running out of idea what to do.
This is the Inventory.h:
Here is the Inventory.cpp:
Here is the source.cpp:
Can anyone see what I did wrong? Here is the error list:
thanks
This is the Inventory.h:
C++:
#ifndef Inventory_H
#define Inventory_H
class Inventory
{
public:
void writeRec();
void displayRec();
}
#endif
Here is the Inventory.cpp:
C++:
#include <iostream>
#include "Inventory.h"
void Inventory::writeRec()
{ std::cout << " In writeRec.\n\n";}
void Inventory::displayRec()
{ std::cout << " In DisplayRec.\n\n";}
Here is the source.cpp:
C++:
#include <iostream>
#include "Inventory.h"
int main()
{
Inventory Inv;
Inv.writeRec();
Inv.displayRec();
return 0;
}
thanks