|
From: Von B. <vo...@gm...> - 2007-03-19 00:08:22
|
I am using Dev C++ version 4.9.9.2 w/ Windows XP. I am writing a program
for class that requires me to use inheritance. Below is the header files
for the base class and the derived class.
BASE CLASS:
#include<iostream>
#include<iomanip>
#include<stdlib.h>
using namespace std;
#include "Node.h"
class Queue
{
protected:
NodePtr Front;
NodePtr Rear;
int Count;
void QueueError(char* Mesg);
public:
Queue();
~Queue();
void displayAll();
void addRear(int item);
void deleteFront(int& item);
int getSize();
bool isEmpty();
bool full();
};
#endif // LinkedQueue_H
DERIVED CLASS:
#ifndef LinkedList_H
#define LinkedList_H
#include<iostream>
#include<iomanip>
#include<stdlib.h>
using namespace std;
class LL: public Queue
{
public:
void addFront(int NewNum);
void deleteRear(int& OldNum);
int search(int& Key);
void deleteIth(int I, int& OldNum);
};
#endif //LinkedList_H
COMPILE LOG:
Compiler: Default compiler
Building Makefile: "C:\Documents and
Settings\Von\Desktop\HW3\Pt2\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Von\Desktop\HW3\Pt2\Makefile.win" all
g++.exe -c LinkedList.cpp -o
LinkedList.o-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2"
-I"C:/Dev-Cpp/include"
In file included from LinkedList.cpp:10:
LinkedList.h:11: error: expected class-name before '{' token
make.exe: *** [LinkedList.o] Error 1
Execution terminated
|
|
From: pwm <pw...@ia...> - 2016-03-12 12:25:05
|
So are you including your queue header file before the second header file?
Next thing - This is a dead forum for a product that hasn't been updated
in many years. Consider switching to a recent version of Code::Blocks
instead.
/Per W
On Sun, 18 Mar 2007, Von Baetiong wrote:
> I am using Dev C++ version 4.9.9.2 w/ Windows XP. I am writing a program for class that requires me to use inheritance. Below is
> the header files for the base class and the derived class.
>
> BASE CLASS:
>
> #include<iostream>
> #include<iomanip>
> #include<stdlib.h>
>
> using namespace std;
>
> #include "Node.h"
>
> class Queue
> {
> protected:
> NodePtr Front;
> NodePtr Rear;
> int Count;
> void QueueError(char* Mesg);
> public:
> Queue();
> ~Queue();
>
> void displayAll();
> void addRear(int item);
> void deleteFront(int& item);
> int getSize();
> bool isEmpty();
> bool full();
> };
>
> #endif // LinkedQueue_H
>
> DERIVED CLASS:
>
> #ifndef LinkedList_H
> #define LinkedList_H
>
> #include<iostream>
> #include<iomanip>
> #include<stdlib.h>
>
> using namespace std;
>
> class LL: public Queue
> {
>
> public:
> void addFront(int NewNum);
> void deleteRear(int& OldNum);
> int search(int& Key);
> void deleteIth(int I, int& OldNum);
>
> };
> #endif //LinkedList_H
>
> COMPILE LOG:
>
> Compiler: Default compiler
> Building Makefile: "C:\Documents and Settings\Von\Desktop\HW3\Pt2\Makefile.win"
> Executing make...
> make.exe -f "C:\Documents and Settings\Von\Desktop\HW3\Pt2\Makefile.win" all
> g++.exe -c LinkedList.cpp -o LinkedList.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
> -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
>
> In file included from LinkedList.cpp:10:
> LinkedList.h:11: error: expected class-name before '{' token
>
> make.exe: *** [LinkedList.o] Error 1
>
> Execution terminated
>
>
> |
|
From: mofana m. <mo...@nu...> - 2016-03-18 09:47:41
|
There must be corresponding
#if...
before your
#endif // LinkedQueue_H
>
>> I am using Dev C++ version 4.9.9.2 w/ Windows XP. I am writing a
>> program for class that requires me to use inheritance. Below is
>> the header files for the base class and the derived class.
>>
>> BASE CLASS:
>>
>> #include<iostream>
>> #include<iomanip>
>> #include<stdlib.h>
>>
>> using namespace std;
>>
>> #include "Node.h"
>>
>> class Queue
>> {
>> protected:
>> NodePtr Front;
>> NodePtr Rear;
>> int Count;
>> void QueueError(char* Mesg);
>> public:
>> Queue();
>> ~Queue();
>>
>> void displayAll();
>> void addRear(int item);
>> void deleteFront(int& item);
>> int getSize();
>> bool isEmpty();
>> bool full();
>> };
>>
>> #endif // LinkedQueue_H
>>
>> DERIVED CLASS:
>>
>> #ifndef LinkedList_H
>> #define LinkedList_H
>>
>> #include<iostream>
>> #include<iomanip>
>> #include<stdlib.h>
>>
>> using namespace std;
>>
>> class LL: public Queue
>> {
>>
>> public:
>> void addFront(int NewNum);
>> void deleteRear(int& OldNum);
>> int search(int& Key);
>> void deleteIth(int I, int& OldNum);
>>
>> };
>> #endif //LinkedList_H
>>
>> COMPILE LOG:
>>
>> Compiler: Default compiler
>> Building Makefile: "C:\Documents and
>> Settings\Von\Desktop\HW3\Pt2\Makefile.win"
>> Executing make...
>> make.exe -f "C:\Documents and
>> Settings\Von\Desktop\HW3\Pt2\Makefile.win" all
>> g++.exe -c LinkedList.cpp -o LinkedList.o
>> -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
>> -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
>> -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
>> -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
>>
>> In file included from LinkedList.cpp:10:
>> LinkedList.h:11: error: expected class-name before '{' token
>>
>> make.exe: *** [LinkedList.o] Error 1
>>
>> Execution terminated
>>
>>
---
-------------------------------------------
mofana mphaka
Mathematics and Computer Science Department
National University of Lesotho
LESOTHO
mailto:mof...@gm...; cc: mo...@nu...
http://cs.nul.ls/~mofana
Cell: (+266) 63167562
Office: (+266) (5221)3518
Home: (+266) 27058532
---------------------------------------------------------------------------
|
|
From: Sumanta B <sum...@gm...> - 2016-03-27 16:27:42
|
Guys why are you still using devc++. Use visual studio and get rid of all
errors
On Fri, Mar 18, 2016 at 2:59 PM, mofana mphaka <mo...@nu...> wrote:
> There must be corresponding
> #if...
>
> before your
>
> #endif // LinkedQueue_H
>
>
> >
> >> I am using Dev C++ version 4.9.9.2 w/ Windows XP. I am writing a
> >> program for class that requires me to use inheritance. Below is
> >> the header files for the base class and the derived class.
> >>
> >> BASE CLASS:
> >>
> >> #include<iostream>
> >> #include<iomanip>
> >> #include<stdlib.h>
> >>
> >> using namespace std;
> >>
> >> #include "Node.h"
> >>
> >> class Queue
> >> {
> >> protected:
> >> NodePtr Front;
> >> NodePtr Rear;
> >> int Count;
> >> void QueueError(char* Mesg);
> >> public:
> >> Queue();
> >> ~Queue();
> >>
> >> void displayAll();
> >> void addRear(int item);
> >> void deleteFront(int& item);
> >> int getSize();
> >> bool isEmpty();
> >> bool full();
> >> };
> >>
> >> #endif // LinkedQueue_H
> >>
> >> DERIVED CLASS:
> >>
> >> #ifndef LinkedList_H
> >> #define LinkedList_H
> >>
> >> #include<iostream>
> >> #include<iomanip>
> >> #include<stdlib.h>
> >>
> >> using namespace std;
> >>
> >> class LL: public Queue
> >> {
> >>
> >> public:
> >> void addFront(int NewNum);
> >> void deleteRear(int& OldNum);
> >> int search(int& Key);
> >> void deleteIth(int I, int& OldNum);
> >>
> >> };
> >> #endif //LinkedList_H
> >>
> >> COMPILE LOG:
> >>
> >> Compiler: Default compiler
> >> Building Makefile: "C:\Documents and
> >> Settings\Von\Desktop\HW3\Pt2\Makefile.win"
> >> Executing make...
> >> make.exe -f "C:\Documents and
> >> Settings\Von\Desktop\HW3\Pt2\Makefile.win" all
> >> g++.exe -c LinkedList.cpp -o LinkedList.o
> >> -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
> >> -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
> >> -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
> >> -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
> >>
> >> In file included from LinkedList.cpp:10:
> >> LinkedList.h:11: error: expected class-name before '{' token
> >>
> >> make.exe: *** [LinkedList.o] Error 1
> >>
> >> Execution terminated
> >>
> >>
>
> ---
> -------------------------------------------
> mofana mphaka
> Mathematics and Computer Science Department
> National University of Lesotho
> LESOTHO
>
> mailto:mof...@gm...; cc: mo...@nu...
> http://cs.nul.ls/~mofana
> Cell: (+266) 63167562
> Office: (+266) (5221)3518
> Home: (+266) 27058532
> ---------------------------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|