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.
|