I am facing strange problem.
I am compiling a MFC application(VS 2008) which uses static library MyLib.lib.it is compiling fine in debug mode.
but in Debug Unicode it is showing error.I am using Debug Unicode version of MyLib.lib in MFC application.
Main.obj : error LNK2019: unresolved external symbol "void * __cdecl VCI_Open_Device(wchar_t *)" (?VCI_Open_Device@@YAPAXPA_W@Z) referenced in function _wmain
VCIHANDLE
VCI_Open_Device ( TCHAR *ptszDevicePath
);
Here I notice in MFC App that in debug mode TCHAR is typedef char TCHAR, which is correct but in Debug Unicode mode TCHAR should be typedef WCHAR TCHAR but here also it showing typedef char TCHAR.
I checked in WebCam.lib Project TCHAR is typedef WCHAR TCHAR in Debug Unicode mode which correct.
I guess it is problem with some setting in the Debug Unicode mode in MFC app mode.
Please help resolve this issue.
#ifdef UNICODE // r_winnt
#ifndef _TCHAR_DEFINED
typedef WCHAR TCHAR, *PTCHAR;
typedef WCHAR TBYTE , *PTBYTE ;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */
typedef LPWCH LPTCH, PTCH;
typedef LPCWCH LPCTCH, PCTCH;
typedef LPWSTR PTSTR, LPTSTR;
typedef LPCWSTR PCTSTR, LPCTSTR;
typedef LPUWSTR PUTSTR, LPUTSTR;
typedef LPCUWSTR PCUTSTR, LPCUTSTR;
typedef LPWSTR LP;
typedef PZZWSTR PZZTSTR;
typedef PCZZWSTR PCZZTSTR;
typedef PUZZWSTR PUZZTSTR;
typedef PCUZZWSTR PCUZZTSTR;
typedef PNZWCH PNZTCH;
typedef PCNZWCH PCNZTCH;
typedef PUNZWCH PUNZTCH;
typedef PCUNZWCH PCUNZTCH;
#define __TEXT(quote) L##quote // r_winnt
#else /* UNICODE */ // r_winnt
#ifndef _TCHAR_DEFINED
typedef char TCHAR, *PTCHAR;
typedef unsigned char TBYTE , *PTBYTE ;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */
typedef LPCH LPTCH, PTCH;
typedef LPCCH LPCTCH, PCTCH;
typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR;
typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR;
typedef PZZSTR PZZTSTR, PUZZTSTR;
typedef PCZZSTR PCZZTSTR, PCUZZTSTR;
typedef PNZCH PNZTCH, PUNZTCH;
typedef PCNZCH PCNZTCH, PCUNZTCH;
#define __TEXT(quote) quote // r_winnt
#endif /* UNICODE */
Here when I do right click on TCHAR it is not going in UNICODE part.
Make sure all your stuff is built with the same tchar treatment. Go to Project/Propeties/C-C++/Language/Treat w_chart as Built in Type and check if it is set to the same value for your library/ies as well for the application. The default setting is No (/Zc:wchar_t-)