473,472 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using maps errors

Hi,

WHile iam trying to build my project holding a class carrying map (STL)
as a static data member the following link2001 error is reported .:

WESFWDeviceManager error LNK2001: unresolved external symbol "private:
static class std::map<class std::basic_string<unsigned short,struct
std::char_traits<unsigned short>,class std::allocator<unsigned short>
,unsigned long,struct std::less<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > >,class std::allocator<struct std::pair<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const ,unsigned long> > > CDeviceLicenseMgr::m_mapDriversCount" (?m_mapDriversCount@CDeviceLicenseMgr@@0V?$map@V?$ basic_string@GU?$char_traits@G@std@@V?$allocator@G @2@@std@@KU?$less@V?$basic_string@GU?$char_traits@ G@std@@V?$allocator@G@2@@std@@@2@V?$allocator@U?$p air@$$CBV?$basic_string@GU?$char_traits@G@std@@V?$ allocator@G@2@@std@@K@std@@@2@@std@@A)

any one plz help me in this

Regards ,
Madni

Mar 15 '06 #1
4 2375
Madni wrote:
Hi,

WHile iam trying to build my project holding a class carrying map (STL)
as a static data member the following link2001 error is reported .:

WESFWDeviceManager error LNK2001: unresolved external symbol "private:
static class std::map<class std::basic_string<unsigned short,struct
std::char_traits<unsigned short>,class std::allocator<unsigned short>
,unsigned long,struct std::less<class std::basic_string<unsigned
short,struct std::char_traits<unsigned short>,class
std::allocator<unsigned short> > >,class std::allocator<struct
std::pair<class std::basic_string<unsigned short,struct
std::char_traits<unsigned short>,class std::allocator<unsigned short> >
const ,unsigned long> > > CDeviceLicenseMgr::m_mapDriversCount"
(?m_mapDriversCount@CDeviceLicenseMgr@@0V?$map@V ?$basic_string@GU
$char_traits@G@std@@V?$allocator@G@2@@std@@KU?$les s@V?$basic_string@GU
$char_traits@G@std@@V?$allocator@G@2@@std@@@2@V?$a llocator@U?$pair@$$CBV
$basic_string@GU?$char_traits@G@std@@V
$allocator@G@2@@std@@K@std@@@2@@std@@A)

any one plz help me in this


Not really - without seeing any code I can only guess. But maybe its worth
reading FAQ 10.11. at http://www.parashift.com/c++-faq-lite.

Mathias
Mar 15 '06 #2

Madni wrote:
Hi,

WHile iam trying to build my project holding a class carrying map (STL)
as a static data member the following link2001 error is reported .:

WESFWDeviceManager error LNK2001: unresolved external symbol "private:
static class std::map<class std::basic_string<unsigned short,struct
std::char_traits<unsigned short>,class std::allocator<unsigned short>
,unsigned long,struct std::less<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > >,class std::allocator<struct std::pair<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const ,unsigned long> > > CDeviceLicenseMgr::m_mapDriversCount" (?m_mapDriversCount@CDeviceLicenseMgr@@0V?$map@V?$ basic_string@GU?$char_traits@G@std@@V?$allocator@G @2@@std@@KU?$less@V?$basic_string@GU?$char_traits@ G@std@@V?$allocator@G@2@@std@@@2@V?$allocator@U?$p air@$$CBV?$basic_string@GU?$char_traits@G@std@@V?$ allocator@G@2@@std@@K@std@@@2@@std@@A)

any one plz help me in this

Regards ,
Madni


Seems you have not defined the map object globally.
Could you post the code you are getting error so that we can look into
furthur.

Mar 15 '06 #3
thanks for reply .... yes my map object is not declared globally rather
its a static data member ... i wonder if i could use map as a static
member as i have never use it like before ... any ways following is a
header file carrying the map object declaration and its use ....
WESString is a wrapper class

#include <MAP>
using namespace std;

typedef map<WESString,DWORD>::iterator MAPITR;
class CDeviceLicenseMgr
{
public:
CDeviceLicenseMgr(void);
virtual ~CDeviceLicenseMgr(void);

inline static DWORD getActiveDAClientCount (WESString wstrDriverName)
{
CSQSCriticalSectionGuard cs(m_cs);
MAPITR itr = m_mapDriversCount.find(wstrDriverName);
if(itr != m_mapDriversCount.end()) // if driver is there
{
return itr->second;

}

return 0; // driver not found
}

inline static void setActiveDAClientCount (WESString wstrDriverName,
DWORD dwCount)
{
CSQSCriticalSectionGuard cs(m_cs);
MAPITR itr = m_mapDriversCount.find(wstrDriverName);
if(itr != m_mapDriversCount.end())
{
itr->second = dwCount;
}

}

inline static void incrementActiveDAClientCount (WESString
wstrDriverName)
{
CSQSCriticalSectionGuard cs(m_cs);
MAPITR itr = m_mapDriversCount.find(wstrDriverName);
if(itr != m_mapDriversCount.end()) // if driver name is in the map
{
DWORD temp = itr->second;
temp++;
itr->second = temp;
}
else // add driver name in the map and initialize count to 1
{
m_mapDriversCount.insert(make_pair(wstrDriverName, 1));
}
}

inline static void decrementActiveDAClientCount (WESString
wstrDriverName)
{
CSQSCriticalSectionGuard cs(m_cs);
MAPITR itr = m_mapDriversCount.find(wstrDriverName);
if(itr != m_mapDriversCount.end())
{
DWORD temp = itr->second;
temp--;
itr->second = temp;
}
//dwActiveDAClientCount-- ; find driver in map and decrement
accordingly
}

static bool validateActiveDAClientCountLicense(WESString
wstrDriverName);
static HRESULT validateLicenseForNewActiveDAClient(const WESContext
&a_wcx, WESString wstrDriverName);
static void updateLicenseForDeleteActiveDAClient(const WESContext
&a_wcx, WESString wstrDriverName);

private:
static DWORD dwExternalDAClientCount;
static DWORD dwActiveDAClientCount;
static CSQSCriticalSection m_cs;
static map<WESString,DWORD> m_mapDriversCount;

};

Mar 15 '06 #4
i've figured out the problem ...on the top of the DeviceLicenseMgr.cpp
i should put the line :
map<WESString,DWORD> CDeviceLicenseMgr::m_mapDriversCount;

this resolves the issue ,.... thanks all u guys for ur positive replies
...

Madni

Mar 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Sandys | last post by:
I'm trying to write a mapping function for genealogy. I want to read a gedcom database and plot an icon at a geographic location based on a user's query. Can you help me find: 1) A python...
2
by: Old Monk | last post by:
Hi all, Say I have two maps m1 and m2. Both have key as std::string and value as long. m1 could hold entries like "abc" 123 "def" 456 m2 could have entries like
3
by: Sean | last post by:
Have you ever wanted to add the great features inherent in Google Maps? Here is how you do it. ============== == STEP ONE == ============== Create a new MS Access form called frmGoogleMap....
0
by: Fraser Dickson | last post by:
I am building a web based system using ASP.NET and VB.NET which has to interact with a web service which uses XML WDDX packets. I have been given the XML Packet Specification by the Web Service...
6
by: Sam Carleton | last post by:
Ok, over the years I have read about doing web programing and I have done some real basic stuff. Now I am digging into some real ASP.Net 2.0 and am totally lost some things. I have a master...
8
by: Anamika | last post by:
Can I have maps with following properties? Key= A character strings... Value=A structure... Members of structure will be two character strings.... If yes how to do that?Can anyone tell me the...
4
by: John Morgan | last post by:
I have been looking at the Microsoft Virtual Earth SDK. As far as I can see I have to incorporate it in a web page using a control based on Javascript through web services It being a Microsoft...
5
by: xml .NET group | last post by:
Is there any book on using ASP.NET for Google Maps. For example, following books: http://www.amazon.com/Beginning-Google-Maps-Applications-Ajax/dp/1590597079/ ...
0
by: geronimo.gpe | last post by:
I need to show maps of arcview in a web application with visual Studio .net. The maps need to be actualized automatically if the Data Base is modified. We are using a SQL Database that is used to...
3
by: Phil Stanton | last post by:
I have a button on a form which when pressed displays a google map of the address. Code is Private Sub Googlemap_Click() MakeURL ("") End Sub
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.