Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

'winscard.lib' link error

100 views
Skip to first unread message

Norbert

unread,
Jul 1, 2009, 3:04:01 PM7/1/09
to

I've received some code I'm trying to compile. I've installed eMbedded
Visual C++ 4.0 with SP2. When I try to build the project, I receive the
following link error:

winscard.lib(WinSCard.dll) : fatal error LNK1112: module machine type 'X86'
conflicts with target machine type 'SH4'

How does one get a hold of the proper version of the this library?

Erwin Zwart

unread,
Jul 2, 2009, 4:25:09 AM7/2/09
to

Hi,

Next to the fact that there is an SP4 for Embedded Visual C++ 4.0 (maybe
a typo?) this probably has got something to do with your project settings.

Check your linker settings. I can remember I had these kinds of issues
when adding another configuration to my project and this is not handled
correctly by EVC.

This links provides some info (but this is about VS2005):
http://msdn.microsoft.com/en-us/library/ms838270.aspx
http://msdn.microsoft.com/en-us/library/ms838254.aspx


Good luck,

Erwin Zwart,
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Norbert schreef:

Norbert

unread,
Jul 2, 2009, 10:06:01 AM7/2/09
to

I failed to mention that the target OS is WinCE 4.2. In the article you
linked, it appears only WinCE 5 and above are supported in .NET.

Is there an SDK I've missed (that includes the 'CE Version' of winscard.lib)?

Thanks

Norbert

unread,
Jul 2, 2009, 10:11:03 AM7/2/09
to

Oh, and I'm downloading SP4; thanks for the heads up.

Erwin Zwart

unread,
Jul 2, 2009, 10:28:44 AM7/2/09
to

The SDK should be provide by the OEM of your device. This SDK provide
you all the libs and header file 'supported' by your device.

What SDK are you using? Are you using the specific one for your device
provided by the OEM?

The error message you've mentioned that you targeting against the wrong
libs.

In the links I provided there is mentioned what to change when you get
this error. Although this is indeed VS2005, try modify your linker
settings in your EVC project according to that, or...

Create a simple helloworld application, build it and deploy it. When
this is successful, compare your project settings with the project which
give you this error......

Norbert

unread,
Jul 2, 2009, 11:03:02 AM7/2/09
to

I suppose I'm not using any SDK? I've only installed Embedded Visual C++ 4.0
(now with SP4). I have VC 6.0 and the Platform SDK installed, so I was
pointing to the winscard.lib in each of those. Of course, it's not the
correct version needed for WinCE 4.2 projects.

What I was trying to figure out here is this: Do I need to install anything
else (beyond the studio) in order to build an app to run on CE 4.2? I didn't
see a Wndows CE SDK of any sort in my MSDN downloads. I'll look for a bit
longer.

I guess I need to just ask the manufacturer for their SDK. Winscard.dll is
a Microsoft DLL, I figured it would come bundled with a Microsoft studio or
SDK (not provided by a third party).

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 11:18:48 AM7/2/09
to

The device builder decides what component of the operating system are in
their device. It's up to them entirely. If a given device does not have
winscard, you CANNOT ADD IT. The SDK for the specific device has to be used
to develop for a device for just this reason. You don't know what things
are there in the device and what things are not. The SDK should prevent you
from writing code that will try access some feature that does not exist in
the device.

Paul T.

"Norbert" <Nor...@discussions.microsoft.com> wrote in message
news:74EE3A9F-3912-41E3...@microsoft.com...

Chris Tacke, eMVP

unread,
Jul 2, 2009, 11:22:55 AM7/2/09
to

You must install an SDK for the device. When you create a project, it asks
what SDKs you plan to target, so I'm confused how you even have created a
project.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Norbert" <Nor...@discussions.microsoft.com> wrote in message
news:74EE3A9F-3912-41E3...@microsoft.com...

Norbert

unread,
Jul 2, 2009, 12:08:02 PM7/2/09
to

I've inherited this code.

Ok, so you are saying that the missing wincard.lib would typically reside in
an SDK provided by the device manufacturer.

I've also been told that the target smart card reader runs WinCE 4.2 and
doesn't have an SDK ( "No target reader API it uses winscard").

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 12:33:19 PM7/2/09
to

If there's no SDK, you can't write code for it. What SDK are you supposed
to use? There is no "default SDK" or "general SDK". A Windows CE device
can vary from something with a full user-interface, including Internet
Explorer, SQL Server Compact, etc., etc. to something that doesn't even have
a user interface, no CreateWindow, no message loops. You can't have a
single SDK that will support both of those types of devices reasonably.

Tell us how this is supposed to work. You started out compiling for x86.
Why? Where did this code come from? Are you sure that it's even targeted
at Windows CE and not desktop Windows?

Paul T.

"Norbert" <Nor...@discussions.microsoft.com> wrote in message

news:41E02211-3B20-40E0...@microsoft.com...

Norbert

unread,
Jul 2, 2009, 12:47:01 PM7/2/09
to

This is an application which runs on a Device (DataStrip DSVII); it's
equipped with a Smart Card Reader. This device is running WinCE 4.2. The
application has two configurations:

Win32 (WCD SH4) Release
Win32 (WCD SH4) Debug

In project Settings->Preprocessor Definitions:
SHx,SH4,_SH4_,UNDER_CE=$(CEVersion),_WIN32_WCE=$(CEVersion),$(CePlatform),UNICODE,_UNICODE,NDEBUG,_AFXDLL

The workspace/project are .vcw/.vcp files, not .dsw/.dsp files.


Was the person I spoke with incorrect in that there should be an SDK for
this device wherein I will find the missing winscard.lib?

Hope this helps,
Thank you.

Norbert

unread,
Jul 2, 2009, 1:00:01 PM7/2/09
to

Oh, the initial link error I posted was due to the fact that I had added my
VC6 lib path to the eMbedded Lib Path settings. So the project was trying to
link to a version of winscard.lib intended for desktop.

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 1:05:40 PM7/2/09
to

I don't see any way that they could be correct in saying that they don't
have an SDK for the device, unless they don't support third-parties, like
you, adding programs to the device at all.

According to the DataStrip Web site, the device appears to be running CE5,
so you have an old one? I agree that they don't make it clear where you get
an SDK for the device (I don't suppose it came with a CD?)

Paul T.

"Norbert" <Nor...@discussions.microsoft.com> wrote in message

news:26C5AC1A-2F1C-4144...@microsoft.com...

Chris Tacke, eMVP

unread,
Jul 2, 2009, 2:29:49 PM7/2/09
to

Where did the WCD SDK come from? It certainly wan't part of eVC, so you've
added that on. If after adding it you get a linker error about
winscard.lib, it means that it's not in the SDK, and therefore not supported
by the target device.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Norbert" <Nor...@discussions.microsoft.com> wrote in message

news:26C5AC1A-2F1C-4144...@microsoft.com...

Norbert

unread,
Jul 2, 2009, 2:39:01 PM7/2/09
to

I don't have a WCD SDK. I wasn't even sure what 'WCD' meant (in the
Configuration name). Anyhow, it appears that I did not receive all the
source code/libraries necessary to compile this project.

Norbert

unread,
Jul 2, 2009, 2:33:01 PM7/2/09
to

Ok, I think they do have an SDK, but it's like pulling teeth with these guys.
I'll find out more on Monday.

Last Question: Is there a CE 4.2 SDK? I would think it would contain the
winscard.lib. I didn't see in my list of downloads under my MSDN
subscription. If so, I could at least compile this code.

Thanks so much

Chris Tacke, eMVP

unread,
Jul 2, 2009, 3:36:08 PM7/2/09
to

There's no such thing as a "CE 4.2 SDK". Windows CE is totally modular. The
SDK is therefore infinitely variable, as it describes what features and APIs
are in an OS image. An SDK is tied intrisically to the OS image.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Norbert" <Nor...@discussions.microsoft.com> wrote in message

news:177D87B1-D1B1-4579...@microsoft.com...

Paul G. Tobey [eMVP]

unread,
Jul 2, 2009, 3:39:42 PM7/2/09
to

No, and for the reasons I mentioned last time, there cannot be! CE is not
*a* thing. It's a configurable operating system that can be set up with any
combination of components, resulting in thousands of possible combinations.

Where are you getting the headers to compile with? You can't use desktop
Windows headers to compile for a Windows CE device!

Paul T.

"Norbert" <Nor...@discussions.microsoft.com> wrote in message

news:177D87B1-D1B1-4579...@microsoft.com...

Norbert

unread,
Jul 2, 2009, 4:54:04 PM7/2/09
to

Ok, understood. I should hopefully get a hold of the this device's SDK soon.

Thanks for all the help. This forum is very helpful.

0 new messages