NO

Author Topic: How do I use SCardEstablishContext from winscard.lib (WinCE 5.0)  (Read 7993 times)

hongchng

  • Guest
Hi,

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,
                                NULL,
                                NULL,
                                &hSC);
if ( SCARD_S_SUCCESS != lReturn )
    printf("Failed SCardEstablishContext\n");
else
{
    // 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?

thanks,
Hong