ZakiMaksyutov
Programmer
Hi!
I've encountered with one problem and I don't understand what's wrong.
I created EXE-server with ATL COM AppWizard (free thread, _ATL_FREE_THREADED).
And I use
static CComAutoCriticalSection m_cs; in my class.
I defined this object:
CComAutoCriticalSection MyClass::m_cs;
And all is ok in debug mode. I can compile the project, use it and my critical section works fine. But when I try to compile my project in ReleaseMinDependency, then I get link error L2001: unresolved symbol _main. When I clear away
strings about CComAutoCriticalSection all works again.
Moreover, I can use CComCriticalSection. In this case also works fine. In fact I had to write my class which analog CComAutoCriticalSection:
-------------------------------------
class CComMyAutoCriticalSection
{
public:
CComMyAutoCriticalSection(){
m_cs.Init();
}
~CComMyAutoCriticalSection(){
m_cs.Term();
}
void Lock() { m_cs.Lock(); }
void Unlock() { m_cs.Unlock(); }
private:
CComCriticalSection m_cs;
};
-------------------------------------
Question: what's problem with CComAutoCriticalSection in EXE-server in ReleaseMinDependecy?
Any help will be appreciated.
I've encountered with one problem and I don't understand what's wrong.
I created EXE-server with ATL COM AppWizard (free thread, _ATL_FREE_THREADED).
And I use
static CComAutoCriticalSection m_cs; in my class.
I defined this object:
CComAutoCriticalSection MyClass::m_cs;
And all is ok in debug mode. I can compile the project, use it and my critical section works fine. But when I try to compile my project in ReleaseMinDependency, then I get link error L2001: unresolved symbol _main. When I clear away
strings about CComAutoCriticalSection all works again.
Moreover, I can use CComCriticalSection. In this case also works fine. In fact I had to write my class which analog CComAutoCriticalSection:
-------------------------------------
class CComMyAutoCriticalSection
{
public:
CComMyAutoCriticalSection(){
m_cs.Init();
}
~CComMyAutoCriticalSection(){
m_cs.Term();
}
void Lock() { m_cs.Lock(); }
void Unlock() { m_cs.Unlock(); }
private:
CComCriticalSection m_cs;
};
-------------------------------------
Question: what's problem with CComAutoCriticalSection in EXE-server in ReleaseMinDependecy?
Any help will be appreciated.