Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Problem with CyAPI.lib and Qt

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



Problem with CyAPI.lib and Qt
Moderator:
RSKV

Post Reply
Follow this topic



Problem with CyAPI.lib and Qt

mrainer posted on 30 Nov 2012 3:48 AM PST
Member
7 Forum Posts

 

Hello. I'm working on a software that interacts with a FX3 board using the Cypress API. This software works fine and its GUI it's written in Visual Studio (C++). Now my task is to realize an alternative GUI using Qt. This other software should work fine too, as I'm changing only the graphical interface and I'm not modifying anything on the lower side of the code, but I really can't get the Qt creator to link against the CyAPI.lib static libraries.

 

The code builds normally, but at the linking time it fails with this message:

 

 

 12:29:18: Starting: "C:\Qt\qtcreator-2.6.0\bin\jom.exe"

C:\Qt\qtcreator-2.6.0\bin\jom.exe -f Makefile.Debug

link /LIBPATH:"c:\Qt\4.8.3\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\UlaDLQt.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\UlaDLQt.exe @C:\DOCUME~1\M_RAIN~1\IMPOST~1\Temp\UlaDLQt.exe.3052.15.jom

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__UnregisterDeviceNotification@4 referenced in function "public: void __thiscall CCyUSBDevice::DestroyHandle(void)" (?DestroyHandle@CCyUSBDevice@@QAEXXZ)

CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__RegisterDeviceNotificationA@12 referenced in function "private: bool __thiscall CCyUSBDevice::RegisterForPnpEvents(void *)" (?RegisterForPnpEvents@CCyUSBDevice@@AAE_NPAX@Z)

debug\UlaDLQt.exe : fatal error LNK1120: 2 unresolved externals

jom: C:\sw\UlaDLQt-build-Desktop-Debug\Makefile.Debug [debug\UlaDLQt.exe] Error 1120

jom: C:\sw\UlaDLQt-build-Desktop-Debug\Makefile [debug] Error 2

12:29:18: The process "C:\Qt\qtcreator-2.6.0\bin\jom.exe" exited with code 2.

Error while building/deploying project UlaDLQt (target: Desktop)

When executing step 'Make'

 

 

I'm struggling with this since 3 days, but I can't get it working properly. I added the /NODEFAULTLIB:LIBCMT in the makefile, I tried to link the library dinamically, nothing has effect.

 

This is my .pro file:

 

#-------------------------------------------------
#
# Project created by QtCreator 2012-10-18T14:53:43
#
#-------------------------------------------------

QT       += core gui

TARGET = UlaDLQt
TEMPLATE = app


SOURCES += main.cpp\
        uladlqtdlg.cpp \
    UlaUSBDevice.cpp \
    comm_protocol.cpp \
    UlaSM.cpp \
    dummyulaop.cpp \
    UlaState.cpp \
    uladata.cpp

HEADERS  += uladlqtdlg.h \
    UlaUSBDevice.h \
    cyusb.h \
    comm_protocol.h \
    UlaSM.h \
    QObject \
    prepr.h \
    dummyulaop.h \
    UlaState.h \
    CyAPI/inc/CyAPI.h \
    uladata.h

FORMS    += uladlqtdlg.ui

#unix:!macx:!symbian:!win: LIBS += -L$$PWD/../../../../../../usr/lib/ -lcyusb -lusb

#INCLUDEPATH += $$PWD/../../../../../../usr/include
#DEPENDPATH += $$PWD/../../../../../../usr/include



win32: LIBS += -LC:/sw/UlaDLQt/ -lCyAPI -lQtCore -lQtGui

INCLUDEPATH += C:/sw/UlaDLQt
DEPENDPATH += C:/sw/UlaDLQt

win32: PRE_TARGETDEPS += C:/sw/UlaDLQt/CyAPI.lib


I've also tried to change the slashes into backslashes. No effect.
Can you please help me? I really need to solve this problem as quick as I can.

Thank you.




Re: Problem with CyAPI.lib and Qt

mrainer posted on 02 Dec 2012 01:38 AM PST
Member
7 Forum Posts

 Solved. To get it working it was necessary to add the User32.lib static library.



Re: Problem with CyAPI.lib and Qt

Gayathri posted on 02 Dec 2012 09:47 PM PST
Cypress Employee
327 Forum Posts

Cool.... 



Re: Problem with CyAPI.lib and Qt

msharpe posted on 14 Dec 2012 07:11 AM PST
Member
9 Forum Posts

Hi mrainer.

 

I am also attempting to create a GUI using Qt.  Are you using MinGW or MSVC for the compiler?  I am getting an error that says "undefined reference to `CCyUSBDevice::CCyUSBDevice(void*, _GUID, int)'" when I try to create an instance of  CCyUSBDevice.  I have included the CyAPI.lib in my .pro file and referenced the appropriate header files. 






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.