Although I have included header vcl.h, I get a linker error when trying to use TStringList objects in console application. My particular question is how to use TStringList and other vcl components in console applications. Here is my code snippet and the below is the linker error.
[ILINK32 Error] Error: Unresolved external 'Classes::TStringList::' referenced from XXX.OBJ
#pragma hdrstop
#include <tchar.h>
#include <vcl.h>
#include <iostream.h>
#include <conio.h>
#pragma argsused
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
TStringList* AList = new TStringList;
delete AList;
return 0;
}
When you use the Console Wizard to create the project, make sure to enable the 'Use VCL" checkbox: