visual studio - C++ link errors on solution with many projects -


i created c++ solution full of win32 console application projects in following form:

solution

each projects contains .cpp , .h files , in forms there main.cpp includes include lines .h files.

when trying bulid single project lnk2019 - unresolved external symbol seems appear each project when try compile main.

i read many questions , tried deal additional dependencies or build order nothing seems make difference.

i'm attaching errors here single project (button) - guess once figure issue 1 project rest same.

error   1   error lnk2019: unresolved external symbol "public: void __thiscall graphics::clearscreen(void)" (?clearscreen@graphics@@qaexxz) referenced in function "public: virtual void __thiscall button::keydown(int,char)" (?keydown@button@@uaexhd@z)  d:\forms\button\button.obj  button error   2   error lnk2019: unresolved external symbol "public: void __thiscall graphics::setbackground(enum color)" (?setbackground@graphics@@qaexw4color@@@z) referenced in function "public: virtual void __thiscall button::draw(class graphics,int,int,unsigned int)" (?draw@button@@uaexvgraphics@@hhi@z)  d:\forms\button\button.obj  button error   3   error lnk2019: unresolved external symbol "public: void __thiscall graphics::setforeground(enum color)" (?setforeground@graphics@@qaexw4color@@@z) referenced in function "public: virtual void __thiscall button::draw(class graphics,int,int,unsigned int)" (?draw@button@@uaexvgraphics@@hhi@z)  d:\forms\button\button.obj  button error   4   error lnk2019: unresolved external symbol "public: void __thiscall graphics::write(int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?write@graphics@@qaexhhv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@@z) referenced in function "public: virtual void __thiscall button::draw(class graphics,int,int,unsigned int)" (?draw@button@@uaexvgraphics@@hhi@z)  d:\forms\button\button.obj  button error   5   error lnk2019: unresolved external symbol "public: __thiscall control::control(void)" (??0control@@qae@xz) referenced in function "public: __thiscall button::button(int)" (??0button@@qae@h@z) d:\forms\button\button.obj  button error   6   error lnk2019: unresolved external symbol "public: __thiscall control::~control(void)" (??1control@@qae@xz) referenced in function __unwindfunclet$??0button@@qae@h@z$0 d:\forms\button\button.obj  button error   7   error lnk2001: unresolved external symbol "public: virtual void __thiscall control::getallcontrols(class std::vector<class control *,class std::allocator<class control *> > *)" (?getallcontrols@control@@uaexpav?$vector@pavcontrol@@v?$allocator@pavcontrol@@@std@@@std@@@z) d:\forms\button\button.obj  button error   8   error lnk2001: unresolved external symbol "public: virtual void __thiscall control::setwidth(int)" (?setwidth@control@@uaexh@z) d:\forms\button\button.obj  button error   9   error lnk2001: unresolved external symbol "public: virtual void __thiscall control::setvalue(int)" (?setvalue@control@@uaexh@z) d:\forms\button\button.obj  button error   10  error lnk2001: unresolved external symbol "public: virtual void __thiscall control::setforeground(enum color)" (?setforeground@control@@uaexw4color@@@z)    d:\forms\button\button.obj  button error   11  error lnk2001: unresolved external symbol "public: virtual void __thiscall control::setbackground(enum color)" (?setbackground@control@@uaexw4color@@@z)    d:\forms\button\button.obj  button error   12  error lnk2019: unresolved external symbol "public: void __thiscall control::drawbackground(void)" (?drawbackground@control@@qaexxz) referenced in function "public: virtual void __thiscall button::draw(class graphics,int,int,unsigned int)" (?draw@button@@uaexvgraphics@@hhi@z) d:\forms\button\button.obj  button error   13  error lnk2019: unresolved external symbol _main referenced in function ___tmaincrtstartup   d:\forms\button\msvcrtd.lib(crtexe.obj) button error   14  error lnk1120: 13 unresolved externals  d:\forms\debug\button.exe   button 

the .h files paths correct , can see options in intellisense.

i appriciate idea might me resolve issue. thanks

so if understood correctly have 1 project main?

if that's right try build other projects static libraries (.lib)(or shared libraies (.dll)) , reference them main project (forms) should working.

right trying build executable (.exe) 12other .exe. can't work.


Comments

Popular posts from this blog

The SDK directory does not exist (ubuntu 16.04) (react native) -

python - How to clone or copy a list? -

string - Using python and postgres, variables within execute function? -