vector declaration inside class

V

Venkat

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
 
J

Jeff Schwab

Venkat said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top