It would be good to see the full error message to see which function(s) are missing.
If you build your app without MFC support, it is not linked with the library that contains the
CString
support functions. Because you are including
atlstr.h, you are not getting compilation errors. But in the line
TestLib *tst = new TestLib(_T("Test"));
you are creating a temporary
CString
and the constructor calls functions from the MFC library which results in the linker error.
The simplest solution would be changing the second constructor of your library to
TestLib::TestLib(LPCTSTR str)
: _tst(str)
{
}
Then your console application passes a
TCHAR*
pointer instead of creating a temporaray
CString
and the assignment is done within your library which is linked with the MFC library.