Reputation: 9
Exercise 1.20: http://www.informit.com/title/032174113 contains a copy of Sales_item.h
in the Chapter 1 code directory. Copy that file to your working directory. Use it to write a program that reads a set of book sales transactions, writing each transaction to the standard output.
The link it provides does not work, so I downloaded Sales_item.h
from another website.
#include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item sales_item;
while (std::cin >> sales_item)
std::cout << sales_item << std::endl;
return 0;
}
The error say:
Sales_item.h : No such file or directory found
Note: I am using Windows 7 and Code::Blocks.
Upvotes: 0
Views: 1664
Reputation: 1
use:
#include "./Sales_item.h"
You might be getting the error because the linking to Sales_item.h was set incorrectly.
Upvotes: 0
Reputation: 11
Copy the Sales_item.h
source code from the internet, then paste it in your editor, then save the file as Sales_item.h
format thus a header file will be created in the same folder where all your program is saved. Now copy the newly created header file and paste it in your working directory.
The directory is located in windowC:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include
,folder where most of the header files are saved. Save your
sales_item` header file there.
Then compile and run your code smoothly.
Upvotes: 1