vector declaration inside class



 DEVELOP > c-Plus-Plus > vector declaration inside class

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Venkat"
Date: 20 Dec 2003 12:15:25 AM
Object: vector declaration inside class
Hi All,
I am getting unusual compile errors when i declare a vector as a private
member of a class in .h file,
but if i declare the same in .cpp file inside the definition of a function
which is a member of the same class it is working fine.
Here is my .h file
#include <wtypes.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <Winsock2.h>
class A{
private:
std::string ExtractServerFromDSN(std::string& dsn);
long CheckPublisher();
std::string m_Database;
std::string m_DSN;
std::string m_Server;
std::string m_UserID;
std::string m_UserPWD;
odbc::Connection *m_Con;
vector<string> CSVTagNameList;
public:
A(void);
~A();
long DBConnection();
int CIDPDBInstall::fn1(const std::string dialPlan);
int CIDPDBInstall::fn2(const std::string dialPlan);
// TODO: add your methods here.
};
CSVTagNameList vector declaration is giving problems, but the same if i use
in .cpp file inside a public function of above class A works fine.
Can someone tell me if i am missing anything.
regards,
Venkat
.

User: "Jeff Schwab"

Title: Re: vector declaration inside class 20 Dec 2003 12:15:52 AM
Venkat wrote:

Hi All,

I am getting unusual compile errors when i declare a vector as a private
member of a class in .h file,
but if i declare the same in .cpp file inside the definition of a function
which is a member of the same class it is working fine.

Here is my .h file

#include <wtypes.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <Winsock2.h>

class A{
private:
std::string ExtractServerFromDSN(std::string& dsn);
long CheckPublisher();
std::string m_Database;
std::string m_DSN;
std::string m_Server;
std::string m_UserID;
std::string m_UserPWD;
odbc::Connection *m_Con;
vector<string> CSVTagNameList;

std::vector<std::string> CSVTagNameList; // ITYM


public:
A(void);
~A();
long DBConnection();
int CIDPDBInstall::fn1(const std::string dialPlan);
int CIDPDBInstall::fn2(const std::string dialPlan);
// TODO: add your methods here.
};

CSVTagNameList vector declaration is giving problems, but the same if i use
in .cpp file inside a public function of above class A works fine.
Can someone tell me if i am missing anything.


regards,
Venkat



.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER