I have quite a problem:
I use a log class called TLog, whith a constructor:
TLog(bool p_view, char* p_insert, char* p_folder, char* p_file_name);
P_view: On screen True, else writen in file
p_insert: char* to be inserted on the beginning on each line.
p_folder: folder where to write the log file
p_file_name: file name..
My problem is:
I want to creat a GameLog and a SysLog like those:
TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
TLog SysLog(false, "SysLog-", "d:\\log\\", "SysLog.log"
and call them into a projet with many class, some interdependant and some which aren't..
But the problem is: When I compile the linker annouce that I have multiple definition of the GameLog or SysLog identifier.
I have declared those object in multiple place.
In each .cpp with
external TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
or static TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
or in the main programme..
But or the GameLog or SysLog can't be reached by the class actually running, or I have the linker error.
So my question is: Of do I declare 2 object definition OUTSIDE a project, then call them at the compilation without any error.. nor multiple definition of those object (not class, just object).
Thank you
I use a log class called TLog, whith a constructor:
TLog(bool p_view, char* p_insert, char* p_folder, char* p_file_name);
P_view: On screen True, else writen in file
p_insert: char* to be inserted on the beginning on each line.
p_folder: folder where to write the log file
p_file_name: file name..
My problem is:
I want to creat a GameLog and a SysLog like those:
TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
TLog SysLog(false, "SysLog-", "d:\\log\\", "SysLog.log"
and call them into a projet with many class, some interdependant and some which aren't..
But the problem is: When I compile the linker annouce that I have multiple definition of the GameLog or SysLog identifier.
I have declared those object in multiple place.
In each .cpp with
external TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
or static TLog GameLog(false, "GameLog-", "d:\\log\\", "GameLog.log"
or in the main programme..
But or the GameLog or SysLog can't be reached by the class actually running, or I have the linker error.
So my question is: Of do I declare 2 object definition OUTSIDE a project, then call them at the compilation without any error.. nor multiple definition of those object (not class, just object).
Thank you