Linking Error for building project using x64 CyAPI.lib

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
aditya_r07
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

Hello,

I am trying to include the 'CyAPI.lib' from the x64 Cypress library folder and trying to build in C++ 10.4 Builder for the multi target platform. But, I am facing problem with a linker error like "[ilink64 Error] Error: Unresolved external 'CCyUSBDevice::CCyUSBDevice(void*, _GUID, int)..................'  while trying to build. Please find the attached snapshot for more details. 

Any guidance on the matter would be greatly appreciated !!  

@YatheeshD_36 

Thanks,

Aditya

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi Han,

You are right. I came across this weblink C++ Compiler Compatibility - RAD Studio which mentions that VC++ is not compatible with bcc64 platform.

It seems that Embarcadero IDE doesn't support any other C++ compiler except bcc. If yes, cyapi.lib is will not be compatible.

You can use Microsoft Visual Studio (2008 or higher) to build the application using cyapi.lib.  You can also try use cyusb.dll (.NET library). CyUSB.dll is a managed Microsoft .NET class library which enables  its classes and methods can be accessed from any of the Microsoft Visual Stuido.NET managed languages such as Visual Basic.NET, C#, Visual J# and managed C++

Regards,
Rashi

View solution in original post

0 Likes
8 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello Aditya,

Platform set in the Project Properties should match with the Target Machine in the Advanced Linker Setting.

Go to Project Properties -> Configuration Properties -> Linker -> Advanced and set the Target Machine to MachineX86 if the Platform is x86/Win32 or set Target Machine to MachineX64 if the Platform is x64. Refer to Figure  for an example.

YatheeshD_36_0-1609932878626.png

 

This is one of the causes. 

Others are:

1. Missing to include setupapi.lib in linker and setupapi.h as header in source file.

2. CyAPI.lib Library version and Platform set in project should match.

 

 Thanks,

Yatheesh

 

0 Likes
lock attach
Attachments are accessible only for community members.

Hello YatheeshD, 

I have also the same problem as Aditya when compiling CyAPI.lib for x64 WIN application by Embarcadero C ++ Builder 10.4 (not visual studio). I have applied your instruction, but it does not work for Embarcadero C ++ builder 10.4. Herein, C ++ builder 10.4 uses bcc64 compiler that is based on Clang-enhanced C ++ compilers: http://docwiki.embarcadero.com/RADStudio/Sydney/en/BCC64. I think that your provided library CyAPI.lib is not compatible with bcc64 compiler. Thus, this issue appears. Please have a look the photo for the configuration in IDE embarcadero C ++ builder 10.4. I copied CyAPI.lib for x64 from the installed folder: C:\Cypress\Cypress Suite USB 3.4.7\CyAPI\lib\x64. Would you please send me the CyAPI.lib for x64 that is compatible with bcc64 compiler (Clang-enhanced C++ compiler) of embarcadero C ++ builder 10.4. Thank you very much for all your help. 

Best regards,

Han

Hello Yatheesh,

I have tried this method before but it did not work at all for targeting Win 64 bit platform. In addtion to, I even tried adding these libraries on my new project but got the same result. @YatheeshD_36    @Han 

Thanks,

Aditya

0 Likes

Hello Aditya and Han,

Please refer to this resolved thread with similar problem  Solved: Re: CyAPI.lib & VS2017 - Cypress Developer Community

Please confirm if  setupapi.lib is included in linker and setupapi.h as header in source file. 

If this doesn't help please share the complete error log.

@aditya_r07  please let me know which software or IDE is  used to develop the application

Regards,
Rashi
0 Likes

Helllo Rashi,

I have already tried adding setupapi.lib and setupapi.h in the source file but it doesn't work at all.

For the development,  I am  Embarcadero C++ Builder IDE (10.4 version  (https://www.embarcadero.com/fr/products/cbuilder)

Please find the attached snapshot for more details. linking error.png

 

Regards,                                                                                                                                                                                         Aditya

0 Likes

Hello Aditya,

CyAPI.lib is compiled using Microsoft Visual C++  with Visual Studio. As per CyAPI Programmer Reference (2018), CyAPI.lib is available for use with Microsoft Visual Studio.

Embarcadero C++ Builder IDE uses bcc64 compiler. Is that correct?

If yes, please try recompiling CyAPI (EzUSB Suite: CYUSB3_USB_SUITE_SOURCE)source with bcc64 compiler and then statically link the library in the project.

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.
Han
Level 1
Level 1
5 sign-ins First like received First reply posted

Hello Rashi_Vatsa, 

I have recompiled CyAPI with bcc64 (Clang-based enhanced compiler) of Embarcadero C++ Builder IDE.  I have the same problem (please have a look at the attached file).  I think that the provided CyAPI is not compatible for bcc64 compiler. Do you have another solution for that?  

Thank you very much in advance. 

Best regards,

Han

 

 

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi Han,

You are right. I came across this weblink C++ Compiler Compatibility - RAD Studio which mentions that VC++ is not compatible with bcc64 platform.

It seems that Embarcadero IDE doesn't support any other C++ compiler except bcc. If yes, cyapi.lib is will not be compatible.

You can use Microsoft Visual Studio (2008 or higher) to build the application using cyapi.lib.  You can also try use cyusb.dll (.NET library). CyUSB.dll is a managed Microsoft .NET class library which enables  its classes and methods can be accessed from any of the Microsoft Visual Stuido.NET managed languages such as Visual Basic.NET, C#, Visual J# and managed C++

Regards,
Rashi
0 Likes