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 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
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.
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;
};
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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
|
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....
|
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...
|
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...
|
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...
|
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...
|
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/
...
|
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...
|
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
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |