Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Using Cypress USB Library CyAPI.dll[solved]
Forum Updated to NodeBB v4.3 + New Features

Using Cypress USB Library CyAPI.dll[solved]

Scheduled Pinned Locked Moved 3rd Party Software
6 Posts 3 Posters 8.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aobo
    wrote on last edited by
    #1

    Hello all,

    I have been trying to use the library CyAPI.lib provided by Cypress USB Suite 3.4.7

    I put the .lib file in the lib/ folder in the project directory

    It comes with the CyAPI.h header file which is located in the inc/ folder

    My project file looks like this (generated by Qt)

    @
    #Add CyAPI lib
    win32: LIBS += -L$$PWD/lib/ -lCyAPI
    INCLUDEPATH += $$PWD/inc
    DEPENDPATH += $$PWD/inc
    @

    When I compiled it, this is the error:

    @
    mainwindow.obj : error LNK2019: unresolved external symbol "public: __thiscall CCyUSBDevice::~CCyUSBDevice(void)" (??1CCyUSBDevice@@QAE@XZ) referenced in function "public: void __thiscall MainWindow::USB_Init(void)" (?USB_Init@MainWindow@@QAEXXZ)
    mainwindow.obj : error LNK2019: unresolved external symbol "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) referenced in function "public: void __thiscall MainWindow::USB_Init(void)" (?USB_Init@MainWindow@@QAEXXZ)
    mainwindow.obj : error LNK2019: unresolved external symbol "public: __thiscall CCyUSBDevice::CCyUSBDevice(void *,struct _GUID,int)" (??0CCyUSBDevice@@QAE@PAXU_GUID@@H@Z) referenced in function "public: void __thiscall MainWindow::USB_Init(void)" (?USB_Init@MainWindow@@QAEXXZ)
    debug\qtproj.exe : fatal error LNK1120: 3 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    @

    It looks like the lib failed to link. Can someone help me understand why it doesn't link? Is it the library's problem or something failed in the linking process

    I am using Qt5.0.0 by the way, compiled with default parameters

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Does you Qt and CyAPI dll use the same architecture ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aobo
        wrote on last edited by
        #3

        Hi SGalst

        Thanks for the help. I somehow copied the x64 lib into my project directory. with the x86 version, it works now!

        Thanks!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you got it working, don't forget to update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuroro
            wrote on last edited by
            #5

            [quote author="aobo" date="1379296197"]Hi SGalst

            Thanks for the help. I somehow copied the x64 lib into my project directory. with the x86 version, it works now!

            Thanks![/quote]

            Hi aobo, which x64 lib do you copy into project? Is user32.lib?
            Should I create lib/ folder and inc/folder and put in CyAPI.lib and CyAPI.h?
            Thanks!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aobo
              wrote on last edited by
              #6

              Hi.

              Good to see someone else is using this library to do things!

              If you have installed the Cypress USB Suite 3.4.7. There are files in C:/Cypress/Cypress Suite USB 3.4.7/CyAPI

              You want the CyAPI.lib in the lib/x86/ folder (I used the one from x64, which created the problem). Put this in your Qt project directory lib/ then grab all the header files in C:\Cypress\Cypress Suite USB 3.4.7\CyAPI\inc and put them in your project directory inc/ folder

              You can then use the code here to link the library to your project:

              @
              #Add CyAPI lib
              win32: LIBS += -L$$PWD/lib/ -lCyAPI
              INCLUDEPATH += $$PWD/inc
              DEPENDPATH += $$PWD/inc
              @

              Make sure when you use the library, include <Windows.h> because CyAPI uses a lot of the windows definitions.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved