My project has two cpp files and one header file. One cpp file contains the implementation of a single class and its declaration is in the header file. The other cpp file is which contains the int main
function.
One of the constructors of the class includes a TCHAR
parameter and it is cited as the unresolved function in LNK2019
linker error.
I'm using visual studio 2010 and I have set the Character set
option in the project properties to Not Set
so that I can choose between char
and wchar_t
using UNICODE
and _UNICODE
macros.
Currently I have defined these in the beginning of my main cpp file and the header files are included after those two. However, if I define these macros in the beginning of header file, the project compiles perfectly.
Is there anyway to solve this issue ? Or do I have to hard code the class to use either char
or wchar_t
?
Thanks.