473,466 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Doubt on STL vector

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
1 1094
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: {AGUT2}=IWIK= | last post by:
Hello all, It's my fisrt post here and I am feeling a little stupid here, so go easy.. :) (Oh, and I've spent _hours_ searching...) I am desperately trying to read in an ASCII...
9
by: luigi | last post by:
Hi, I am trying to speed up the perfomance of stl vector by allocating/deallocating blocks of memory manually. one version of the code crashes when I try to free the memory. The other version...
7
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
34
by: Adam Hartshorne | last post by:
Hi All, I have the following problem, and I would be extremely grateful if somebody would be kind enough to suggest an efficient solution to it. I create an instance of a Class A, and...
8
by: Ross A. Finlayson | last post by:
I'm trying to write some C code, but I want to use C++'s std::vector. Indeed, if the code is compiled as C++, I want the container to actually be std::vector, in this case of a collection of value...
2
by: robertoviperbr | last post by:
Hello to everybody. I have a doubt see the code: #include <vector> #include <iostream> #include <string> #include <algorithm> #include <sstream> #include <fstream> #include <iomanip>
3
by: crabhunt | last post by:
if I have : vector<int> one(4); vector<int> two(4); and say we assigned 0s to all the elements of one and 1s to all the element of two. and than we do : one = two; in this case the...
1
by: wolverine | last post by:
Hi, I have read that to erase an element from a vector with reverse_iterator we have to use -- vector.erase( (++reverseItr).base()) -- But assuming i have to delete the first element of the...
6
by: amscompit | last post by:
I have a written the following code. #include<iomanip> #include<fstream> #include<vector> #include<cctype> using namespace std;
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.