The error indicates that your project is not linked with the module containing the function
SCardEstablishContext
.
To check if the module is found and linked, use the linker option
/VERBOSE:LIB
and check the output. The
winscard.lib file resides usually in the
lib folder of the Windows SDK directory. This directory should be part of the global library search path.
When using Visual C++, you may also specify dependencies using a pragma directive in one of your source files:
#pragma comment(lib, "Winscard")
Then you don't have to change your project settings.
This simple source should compile and link when using Visual Studio:
#include <winscard.h>
#pragma comment(lib, "Winscard")
void SomeFunc()
{
SCardEstablishContext(0, 0, 0, 0);
}