Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: hongchng on October 05, 2007, 07:05:25 am

Title: How do I use SCardEstablishContext from winscard.lib (WinCE 5.0)
Post by: hongchng on October 05, 2007, 07:05:25 am

Can anyone help with using Smart card and winscard.lib in Pelles C (WinCE 5.0).

I am trying to establish context with the smart card resource manager using the following sample code from MSDN.

// Establish the context.
lReturn = SCardEstablishContext(SCARD_SCOPE_USER,
if ( SCARD_S_SUCCESS != lReturn )
    printf("Failed SCardEstablishContext\n");
    // Use the context as needed. When done,
    // free the context by calling SCardReleaseContext.
    // ...

However, Pelles C is giving me the following compiler error:

POLINK: error: Unresolved external symbol 'SCardEstablishContext'.
POLINK: fatal error: 1 unresolved external(s).

I have included the header file, ie
#include <winscard.h>

and add in the linker option to link the library, ie
 -subsystem:windowsce,3.0 -machine:arm  aygshell.lib coredll.lib corelibc.lib winscard.lib

but I still get the error.

Can someone please help me?