aafulei / color-console

A lightweight header-only C++ library to bring colors to your Windows console with a very-easy-to-use API.
MIT License
257 stars 46 forks source link

LNK1169, LNK2005 Errors #9

Open BehnamGolshani opened 1 year ago

BehnamGolshani commented 1 year ago

Error LNK1169 one or more multiply defined symbols found

Error LNK2005 "void __cdecl hue::set_text(class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?set_text@hue@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in person.obj

Error LNK2005 "void __cdecl hue::set_background(class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?set_background@hue@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in person.obj C++_Weak_ptr

Severity Code Description Project File Line Suppression State Error LNK2005 "void __cdecl hue::set(int,int)" (?set@hue@@YAXHH@Z) already defined in person.obj C++_Weak_ptr


_there are still as many as 300 more link errors like this happend when i tried to compile the program. _when you include color-console library inside a user defined class this link errors happen, but if you use it without being included in any class no errors generate.

please help me what shoul i do now?

FIX the problem sooooooooooooooooooon

leo4048111 commented 1 year ago

same issue here

kkettinger commented 7 months ago

See https://github.com/aafulei/color-console/pull/11 for a fix.