Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > CyAPI.lib - VS2008 x64 Building Error

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



CyAPI.lib - VS2008 x64 Building Error
Moderator:
RSKV

Post Reply
Follow this topic



CyAPI.lib - VS2008 x64 Building Error

wcassan posted on 14 Sep 2009 3:34 AM PST

1 Forum Post
I'm trying to build the example program cydesc.c (Cypress Suite USB 3.4.1) in a 64bit OS (Windows 7) for a 64bit OS (Platform solution x64 and /MACHINE:X64).
CyAPI.lib has unresolved external symbols:
1>cydesc.obj : error LNK2019: unresolved external symbol "public: void __cdecl CCyUSBDevice::Close(void)" (?Close@CCyUSBDevice@@QEAAXXZ) in function main
1>cydesc.obj : error LNK2019: unresolved external symbol "public: void __cdecl CCyUSBDevice::GetDeviceDescriptor(struct _USB_DEVICE_DESCRIPTOR *)" (?GetDeviceDescriptor@CCyUSBDevice@@QEAAXPEAU_USB_DEVICE_DESCRIPTOR@@@Z) in function main
1>cydesc.obj : error LNK2019: unresolved external symbol "public: bool __cdecl CCyUSBDevice:: Open(unsigned char)" (?Open@CCyUSBDevice@@QEAA_NE@Z) in function main
1>cydesc.obj : error LNK2019: unresolved external symbol "public: unsigned char __cdecl CCyUSBDevice:: DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QEAAEXZ) in function main
1>cydesc.obj : error LNK2019: unresolved external symbol "public: __cdecl CCyUSBDevice::CCyUSBDevice(void *,struct _GUID,int)" (??0CCyUSBDevice@@QEAA@PEAXU_GUID@@H@Z) in function main
This happens only when building for x64 while building for Win32 platform solution everything is OK!!!
Is there something to change in the project properties?
Does someone know how to resolve this problem?


Re: CyAPI.lib - VS2008 x64 Building Error

aasi posted on 15 Sep 2009 11:59 AM PST
Cypress Employee
1090 Forum Posts
kind of confusing error... I'll see if i'm able to replicate the issue... i'll update you on whatever i'm able to find...

Re: CyAPI.lib - VS2008 x64 Building Error

mimarsh2 posted on 14 Jan 2010 06:20 AM PST
Member
6 Forum Posts
I am running into this problem as well.

I am compiling for a 64 bit OS using Visual Studio 2005. I am linking against the CyAPI.lib included in Cypress Suite 3.4.1.

Is there another compiler flag I should be using?

Re: CyAPI.lib - VS2008 x64 Building Error

aasi posted on 17 Jan 2010 05:33 PM PST
Cypress Employee
1090 Forum Posts
The currently available cyapi.lib is a x32 version... it will work in wow64 mode i.e. compilation mode to make x32 program run in x64 platform... i don't think you can change anything to make it work in compilation for x64... i heard the release of a x64 version is in plan...

Re: CyAPI.lib - VS2008 x64 Building Error

mimarsh2 posted on 18 Jan 2010 06:04 AM PST
Member
6 Forum Posts
Is there a release time on an x64 CyAPI.lib?


In the 3.4.1 release notes it states:

The new featuers offered in CySuite 3.4 are

2. 64 bit support for cyapi.lib (C++ based API Library)


What does this refer to? Using my original library (I am not sure of the version), the compilation failed saying "CyAPI.lib is an x86 library". When I switched to the new 3.4.1 CyAPI.lib, it no longer complained about being x86 i.e. the compiler thought it was x64, but it had missing symbols. I am not sure how this is possible as I thought a library could only be 32 bit or 64 bit.

Re: CyAPI.lib - VS2008 x64 Building Error

andrewsobotka posted on 22 Jan 2010 11:08 AM PST
Top Contributor
40 Forum Posts
I've had trouble with 64-bit support before. You can force Windows On Windows emulation (WOW) by going to the project's properties and, on the build tab, look for "Platform Target". AnyCPU builds 32-bit apps for 32-bit systems and 64-bit apps for 64-bit systems, while x86 will build 32-bit apps for both 32-bit and 64-bit systems.

Other things I would check are, make sure that the linker is actually going after the correct lib file. I would rename it and try to build again and make sure that it fails with something like library not found.

Also, you could use Dependency Walker (google it) to peek into the lib and see what symbols are there and if they're absent, missing any name mangling, etc.

Re: CyAPI.lib - VS2008 x64 Building Error

allaakselrod posted on 10 Mar 2010 10:32 AM PST
Member
2 Forum Posts
Hi,

Does anyone know if latest CyAPI.dll (3.4.1 with 64 bit support) is compatible with c++ or only with c# ?

All examples in documentatiosn seem to be c#.

I do not manage to get it building with c++ in VS 2008.

If you have any examples for c++ please attach.

Thanks
aa

Re: CyAPI.lib - VS2008 x64 Building Error

mimarsh2 posted on 10 Mar 2010 11:34 AM PST
Member
6 Forum Posts
It is compatible with C++. I am able to build a 32 bit executable using C++ VS 2005.

I am still waiting on a x64 version of the CyApi.lib, which should be released by the end of this month.

What errors are you getting?
What are you linking against?



Re: CyAPI.lib - VS2008 x64 Building Error

allaakselrod posted on 10 Mar 2010 04:30 PM PST
Member
2 Forum Posts
Hi,

I have created the Win Forms application in VS2008 , added DLL as a reference , but I can't create any objects it keeps giving build errors:


e.g. for this line

USBDeviceList usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB);


I get :

1>.\try_wf.cpp(18) : warning C4832: token '.' is illegal after UDT 'CyUSB::CyConst'
1> c:\program files\cypress\cypress suite usb 3.4.1\cyusb.net\lib\cyusb.dll : see declaration of 'CyUSB::CyConst'
1>.\try_wf.cpp(18) : error C2750: 'CyUSB::USBDeviceList' : cannot use 'new' on the reference type; use 'gcnew' instead
1>.\try_wf.cpp(18) : error C2664: 'CyUSB::USBDeviceList::USBDeviceList(unsigned char)' : cannot convert parameter 1 from 'CyUSB::USBDeviceList *' to 'unsigned char'

thanks


Re: CyAPI.lib - VS2008 x64 Building Error

andrewsobotka posted on 11 Mar 2010 01:17 PM PST
Top Contributor
40 Forum Posts
mimarsh, the only thing that would stop you from using the Cypress library on x64 is the driver, and that's already 64-bit compatible. You ought to be able to force the compiler to target 32-bit platforms always (like the above post I made about changing the target from ANYCPU to x86)

aa, it looks like you're trying to used managed extensions for C++. I'm sure it's possible, because .NET languages are supposed to be interchangeable, but personally I think managed C++ is just awful to read, so I can't say I could even write an example.

The first error (warning?!) looks like it's upset that you're using the . operator after CyConst. Try creating a local variable of the same type as CyConst.DEVICES_CYUSB and putting that in there, then passing that local variable to the constructor instead.

It also looks like it's upset about you using "new", and it wants you to use "gcnew" instead. Refer back to "Managed C++ is just awful to read" for more info.

The final error looks like it's just confused about what a CyConst.DEVICES_CYUSB. I'm pretty sure that constant is not a pointer to a USBDeviceList....

Re: CyAPI.lib - VS2008 x64 Building Error

oingoboingo posted on 08 May 2010 09:24 AM PST

1 Forum Post

I also need a 64-bit version of CyAPI.dll that is compatible with c++.  I'm not using c#.  Is this available yet?



Re: CyAPI.lib - VS2008 x64 Building Error

aasi posted on 12 May 2010 10:40 AM PST
Cypress Employee
1090 Forum Posts

Hi Guys,

The 64-bit version of CyAPI.lib is available through SuiteUSB.

 

oingoboingo,

Are you talking about CyAPI.lib or CyUSB.dll??



Re: CyAPI.lib - VS2008 x64 Building Error

CopyBryan posted on 27 Jul 2010 06:00 PM PST

1 Forum Post

I checked the latest SuiteUSB but the CyAPI.lib and example are still used for VC6.0. I am looking forward to CyAPI.lib for VS2005 VC++ urgently. ( Actually I have been looking for it for a long long time )

CyUBS.dll is only for Win Forms App, I don't use Win Forms. ................................Who can hlep me, please?



Re: CyAPI.lib - VS2008 x64 Building Error

alecha posted on 18 Dec 2010 09:41 AM PST
Senior Member
11 Forum Posts

 Hi, i've a problem with creating a new project.

i've installed SuteUSB 3.4.2, then i've created a new project in VS 2008 (i'm using Windows XP 32 bit), i've followed the 7 points of the instructions, but i've some problems:

 

1) after the line #pragma, i've write the following lines:

#include <wtypes.h>

#include <dbt.h>

but when i try to build the solution, this error occurs:

"Fatal Error C1083: cannot include file<wtypes.h> : no file or directory"

 

2) i've tried to comment these two lines, and build.

now i've 240 errors in file CyAPI.h : it's because i cannot include the two previous file??

 

thanks!


 



Re: CyAPI.lib - VS2008 x64 Building Error

Shub posted on 05 Jan 2011 10:02 AM PST
Cypress Employee
27 Forum Posts

Hi Alecha,

The file you are referring to "wtypes.h" is the part of windows SDK.Check if you have this file in "C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wtypes.h" this location. If not install windows sdk.

 



Re: CyAPI.lib - VS2008 x64 Building Error

alecha posted on 05 Jan 2011 11:26 AM PST
Senior Member
11 Forum Posts

hi! thanks for the reply, i've resolve my problem using Windows 7, maybe the Windows SDK is already installed!



Re: CyAPI.lib - VS2008 x64 Building Error

hesam posted on 09 Jul 2012 12:47 AM PST

1 Forum Post

To wcassan

I got the same building error regarding  "DeviceCount"  and "CreateHandle" using CyAPI.lib with winx64. For me it was due to deleting "Setupapi.lib" from linker->input ->AdditionalDependencies. It may seems obvious but in case you made the same mistake as me.
 



Re: CyAPI.lib - VS2008 x64 Building Error

mch posted on 08 May 2013 08:21 PM PST
Member
2 Forum Posts

win7 64bit, must add depend object:Setupapi.lib; CyAPI.lib (x64 )

 

i compile in the vs2010, pass!



Re: CyAPI.lib - VS2008 x64 Building Error

NIKL posted on 08 May 2013 09:32 PM PST
Cypress Employee
148 Forum Posts

Guys

Thanks for sharing the information on the thread.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20