02.08.2014, 15:23. Просмотров 2011. Ответов 23
В книге С.Б. Липпмана C++ Вводный курс в главе 1.5 требуется добавить в программу класс Sales_item.h.Класс я скачал а вот добавить не получается....Пробовал и так и сяк .Выдаёт нету в проге и всё тут...Помогите пожалуйста .Пользуюсь wxDevC++ и MS visual 2010....
Добавлено через 1 час 8 минут
вот код:
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| #include "Sales_item.h"
#include <iostream>
using namespace std;
int main()
{
Sales_item total,trans;
if (cin>>total){
while(cin>>trans)
if(trans.same_isbn(total))
total=total+trans;
else{
cout<<total<<endl;
total=trans;}
cout<<total<<endl}
else
{
cout<<"NO DATA";
return -1;}
return 0;
} |
|
и код ошибки в wxDevC++(журнал компиляции):
Компилятор: Default GCC compiler
Building Makefile: "D:\RER\Makefile.win"
Выполнение make...
mingw32-make.exe -f "Makefile.win" all
g++.exe -c main.cpp -o Objects/MingW/main.o -I"D:/dev/Dev-Cpp/lib/gcc/mingw32/3.4.5/include" -I"D:/dev/Dev-Cpp/include/c++/3.4.5/backward" -I"D:/dev/Dev-Cpp/include/c++/3.4.5/mingw32" -I"D:/dev/Dev-Cpp/include/c++/3.4.5" -I"D:/dev/Dev-Cpp/include" -I"D:/dev/Dev-Cpp/" -I"D:/dev/Dev-Cpp/include/common/wx/msw" -I"D:/dev/Dev-Cpp/include/common/wx/generic" -I"D:/dev/Dev-Cpp/include/common/wx/html" -I"D:/dev/Dev-Cpp/include/common/wx/protocol" -I"D:/dev/Dev-Cpp/include/common/wx/xml" -I"D:/dev/Dev-Cpp/include/common/wx/xrc" -I"D:/dev/Dev-Cpp/include/common/wx" -I"D:/dev/Dev-Cpp/include/common"
In file included from main.cpp:3:
Sales_item.h:41:27: Version_test.h: No such file or directory
main.cpp: In function `int main()':
main.cpp:12: error: 'class Sales_item' has no member named 'same_isbn'
main.cpp:17: error: expected `;' before '}' token
mingw32-make.exe: *** [Objects/MingW/main.o] Error 1
Выполнение завершено
Compilation Failed. Make returned 2