How to overcome this error...
-
I have a class as...
class Log
{public:
Log(string);
void InitializeLog(string);
...class Initialize
{ public:
Initialize(string);
void ReadPropfile(string);
....
};
};next I am doin this...
void Log::InitializeLog(string p_path_name)
{
Initialize obj(p_path_name);
obj.ReadPropfile(p_path_name);
}
void Log::Initialize::ReadPropfile(string log_path)
{....}From the main I call...
Log obj(path); // path is a string
obj.InitializeLog(path);
...When I compile I get the following error. How do I get rid of this
test_utility.obj :error LNK2001: unresolved external symbol "public: __thiscall Log::Log(class std::basic_string,class std::allocator >)" (??0Log@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@
@std@@@Z)
properties.obj : error LNK2001: unresolved external symbol "public: __thiscall Log::Initialize::Initialize(class std::basic_string,class std::allocator >)" (??0Initialize@Log@@QAE@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@@Z)THANKS
-
I have a class as...
class Log
{public:
Log(string);
void InitializeLog(string);
...class Initialize
{ public:
Initialize(string);
void ReadPropfile(string);
....
};
};next I am doin this...
void Log::InitializeLog(string p_path_name)
{
Initialize obj(p_path_name);
obj.ReadPropfile(p_path_name);
}
void Log::Initialize::ReadPropfile(string log_path)
{....}From the main I call...
Log obj(path); // path is a string
obj.InitializeLog(path);
...When I compile I get the following error. How do I get rid of this
test_utility.obj :error LNK2001: unresolved external symbol "public: __thiscall Log::Log(class std::basic_string,class std::allocator >)" (??0Log@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@
@std@@@Z)
properties.obj : error LNK2001: unresolved external symbol "public: __thiscall Log::Initialize::Initialize(class std::basic_string,class std::allocator >)" (??0Initialize@Log@@QAE@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@@Z)THANKS
pl_kode wrote:
class Log {public: Log(string);
forget to implement constructor for Log?
Log::Log(string)
? :)pl_kode wrote:
class Initialize { public: Initialize(string);
And
Initialize::Initialize(string)
too? ;) Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.