By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,045 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Doubt on STL vector

P: n/a
Hi

I am using a "vector" in my code and i added "#include <vector>" in my
header file.

my code has the declaration as:
***************************************
vector<Gerneric_Class*var_name;
*****************************************
where Gerneric_Class is a userdefined class.

I am getting the error when i try compiling the code as:

Error:
************************************************** ********
'vector' is used as a type, but is not defined as a type.
************************************************** *********
why am i getting this error...? am i required to add any lib path for
the STL in my makefile....??

Thanks,

Aug 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"edu.mvk" <ed*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com
Hi

I am using a "vector" in my code and i added "#include <vector>" in my
header file.

my code has the declaration as:
***************************************
vector<Gerneric_Class*var_name;
*****************************************
where Gerneric_Class is a userdefined class.

I am getting the error when i try compiling the code as:

Error:
************************************************** ********
'vector' is used as a type, but is not defined as a type.
************************************************** *********
why am i getting this error...? am i required to add any lib path for
the STL in my makefile....??
try

std::vector<Gerneric_Class*var_name;

Alternatively, after all your #includes, write:

using namespace std;

--
John Carson
Aug 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.