Hi,

I'm developing a simple program in C using pcsclite in Ubuntu. I've
installed libpcsclite-dev. My program simply does a SCardEstablishContext
in main() as follows:

#include <winscard.h>
#include <reader.h>

int main() {
  ULONG err;
  err = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hContext);
  if (err !=SCARD_S_SUCCESS) {
    // some error handling
  }
  return 0;
}

When I try to compile it with "gcc -I/usr/include/PCSC test.c -o test", I
get the following error message:

/tmp/ccpfq23P.o: In function `main':
test.c:(.text+0x5d): undefined reference to `SCardEstablishContext'
collect2: ld returned 1 exit status

May I know what I'm doing wrong? Also, how do I include the PCSC directory
into the include path? winscard.h and reader.h are already in
/usr/include/PCSC but if I don't put -I in gcc, it doesn't detect the files.

Thanks!

-- 
- Goi Sihan
[email protected]
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to