473,236 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

error: ISO C++ forbids declaration of ‘vector’ with no type

Hi..
This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob..

I am having two files .. one is mpcplib.h it contains the follwing declerations....

#include <queue>
#include <vector>
#include <string>
class database {
queue<delayTP> delayThrouput;
queue<deviceStatus> dvStatus;
queue<neighborEntry> neighborConnectivity;
vector<staticRoute> stRouteInfo;
vector<ifaceTable> ifaceInfo;
}

when i compile i m getting the following error..

mpcplib.h:216: error: ISO C++ forbids declaration of ‘queue’ with no type
mpcplib.h:216: error: expected ‘;’ before ‘<’ token
mpcplib.h:217: error: ISO C++ forbids declaration of ‘queue’ with no type
mpcplib.h:217: error: expected ‘;’ before ‘<’ token
mpcplib.h:218: error: ISO C++ forbids declaration of ‘queue’ with no type
mpcplib.h:218: error: expected ‘;’ before ‘<’ token
mpcplib.h:219: error: ISO C++ forbids declaration of ‘vector’ with no type
mpcplib.h:219: error: expected ‘;’ before ‘<’ token
mpcplib.h:220: error: ISO C++ forbids declaration of ‘vector’ with no type
mpcplib.h:220: error: expected ‘;’ before ‘<’ token
mpcplib.h:221: error: ISO C++ forbids declaration of ‘vector’ with no type
mpcplib.h:221: error: expected ‘;’ before ‘<’ token



COULD ANYBODY HELP ME to get rid of this. I already removed using namespace std in my files.

Thanks in advance...
Aug 28 '08 #1
6 14689
JosAH
11,448 Expert 8TB
Have you defined delayTP, deviceStatus etc. as types before you define that database class?

kind regards,

Jos
Aug 28 '08 #2
Have you defined delayTP, deviceStatus etc. as types before you define that database class?

kind regards,

Jos

YEAH, i already defined them in my file...

Thanks
samuel
Aug 28 '08 #3
newb16
687 512MB
If std::queue works instead?
and semicolon after class ClassName{ ... }; <- here
Aug 28 '08 #4
If std::queue works instead?
and semicolon after class ClassName{ ... }; <- here

No use.. ok let me post my entire file..


#include <queue>
#include <vector>
#include <string>

typedef struct networkStat {
char nodeID;
float responseTime;
char status;
}networkStatus;

typedef struct datalinkStat {
char ifaceID;
char subSID;
char status;
}datalinkStatus;

typedef struct dataCom {
char ifaceID;
char subSID;
long byteCount;
}dataCommunication;

typedef struct deviceStat {
char subSID;
char modemID;
char status;
}deviceStatus;

class database {

private:
int updateTable();
int writeTofile();

public:
queue<std::string> MesgSendQueue;
queue<string> MesgRecvQueue;
queue<networkStatus> nwStatus;
queue<dataCommunication> dComm;
queue<datalinkStatus> dlStat;
queue<deviceStatus> dvStatus;
};



This is the code... i called frm main.cpp like this....

database MDbase;

...............................................

this is the total problem.. pls tell me how to solve this...
thanks in advance..
Aug 28 '08 #5
Laharl
849 Expert 512MB
You have <string> and <std::string>. Something look wrong there? You also do need to add the std:: before all those queue declarations, as you don't have using namespace std anymore.
Aug 28 '08 #6
You have <string> and <std::string>. Something look wrong there? You also do need to add the std:: before all those queue declarations, as you don't have using namespace std anymore.

Ok.. i got it by adding std:: before declaring vector...

thanks alot..
Aug 28 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Zach | last post by:
Using Dev-C++ 4.9.8.5 I get error: Compiler: Default compiler Executing g++.exe... g++.exe "C:\winroot\src\c++\stupid_tricks\functor_trick.cpp" -o...
11
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
4
by: James | last post by:
Can someone please help me with these errors? #include <iostream> #include <string> class holder { private: int vid; string vtype;
12
by: arnuld | last post by:
in C++ Primer 4/3 Lippman says in chapter 3, section 3.3.1: vector<stringsvec(10); // 10 elements, each an empty string here is the the code output & output from my Debian box running "gcc...
7
by: i | last post by:
#include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> char ch; int w; int n,m; //void main(); char check(int n,int m,char ch); void cash(int n,int m,char ch);
2
by: brasewel | last post by:
Hi guys, I'm getting an error i cannot figure. Here is my code Header file ------------------------------------------------------------------------------------------- #ifndef Clock_H #define...
2
Ganon11
by: Ganon11 | last post by:
When I try and compile my code, I'm getting the error: In file included from HTTest.cpp:2: HashTable.h:52: error: ISO C++ forbids declaration of `vector' with no type Line 52 from my program is:...
3
by: Hill | last post by:
This is an simple map, just an exercise. Who can help me fix this compile issue?Thanks in advance. #include <string> #include <vector> #include <iostream> using std::vector; using std::string;...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.