I'm having problems implementing a Thread under Win32, using MS Visual C++ 6.0. I'm fairly new to C++ so please bear with me. :)
I have a class named CMonitor that I want to act as a Thread. So I have this in CMonitor.h:
...
#include <cc++/thread.h>
class CMonitor : public Thread
{
....
void Run();
}
Now in CMonitor.cpp, I have the Run() method implemented as the mainline code for this thread. Do I have to put anything in the Constructors for the CMonitor object?
When I compile CMonitor by itself, I get no errors. However, when my entire program is linked I get the following errors:
I have no idea what to make of these linking errors. Is there anything else I'm missing in implemented the Thread? Any help would be *greatly* appreciated!
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having problems implementing a Thread under Win32, using MS Visual C++ 6.0. I'm fairly new to C++ so please bear with me. :)
I have a class named CMonitor that I want to act as a Thread. So I have this in CMonitor.h:
...
#include <cc++/thread.h>
class CMonitor : public Thread
{
....
void Run();
}
Now in CMonitor.cpp, I have the Run() method implemented as the mainline code for this thread. Do I have to put anything in the Constructors for the CMonitor object?
When I compile CMonitor by itself, I get no errors. However, when my entire program is linked I get the following errors:
--------------------------------------------------
CMonitor.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Thread::Notify(class Thread *)" (?Notify@Thread@@UAEXPAV1@@Z)
CMonitor.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall Thread::getExtended(void)" (?getExtended@Thread@@UAEPAXXZ)
CMonitor.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Thread::Final(void)" (?Final@Thread@@MAEXXZ)
CMonitor.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Thread::Initial(void)" (?Initial@Thread@@MAEXXZ)
CMonitor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Thread::~Thread(void)" (__imp_??1Thread@@UAE@XZ)
CMonitor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall Thread::Thread(class Semaphore *,int,unsigned int)" (__imp_??0Thread@@QAE@PAVSemaphore@@HI@Z)
Debug/richdss.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
--------------------------------------------------
I have no idea what to make of these linking errors. Is there anything else I'm missing in implemented the Thread? Any help would be *greatly* appreciated!
Thanks.