c++ - Unresolved external symbol error for overloaded constructor -


actually i've been searching error , found tons of solutions couldn't fix problem , easy can't handle...

/* header */ class employeeregister { private:     empreg *emp; public:     employeeregister(int,int); };   /* cpp file*/ employeeregister::employeeregister(int a,int b) {     cout << "result  : " << a+b << endl; }   /* in main file*/ employeeregister sub(1,1); 

and when or :

main.obj:-1: error: lnk2001: unresolved external symbol "public:     __thiscall employeeregister::employeeregister(int,int)"     (??0employeeregister@@qae@hh@z) 

actually i'm sure easy missing ?

edit : it's fixed , linker couldn't find .cpp file.

make sure non-main .cpp file listed in project (or in linker command-line) can linked main.cpp


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -