- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm linking the static library CyAPI.lib in a Qt project with the following lines in the .pro file:
<code>
unix|win32: LIBS += -L$$PWD/include/SpaMt/GrayskullMt/Cypress/ -lCyAPI
INCLUDEPATH += $$PWD/include/SpaMt/GrayskullMt/Cypress
DEPENDPATH += $$PWD/include/SpaMt/GrayskullMt/Cypress
PRE_TARGETDEPS += $$PWD/include/SpaMt/GrayskullMt/Cypress/CyAPI.lib
</code>
...and I've included the CyAPI.h header file (in the same directory with the other related headers, CyUSB30_def.h, etc) in the source file of a new class and attempted to use several functions, like this:
<code>
#include <SpaMt/GrayskullMt/Cypress/CyAPI.h>
...
gsDevice = new CCyUSBDevice();
...
if(gsDevice->DeviceCount() > 0)
{
gsDevice->Open(0);
}
...
CCyUSBEndPoint *ep = gsDevice->EndPointOf(0x03);
</code>
...but I get an "Undefined reference to <function>" error each time I attempt to use any of the functions provided by CyAPI. This makes me think that the static library is not being linked, as I assume that's where all the functions are defined. However I don't see any qmake errors when it reads the .pro file or any compile-time errors related to the linking of the library. What's going on here? Why am I getting these undefined reference errors? Please help!
As a side note, I had to include '#include <Windows.h>
' to CyUSB30_def.h to have the various UCHAR, UINT, etc keywords recognized by the compiler. I thought it was strange this was left out, so maybe I'm breaking something here.
Thanks,
Forrest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We found that the CyAPI lib was compiled with MSVC and so was not compatible with out Qt project using the MinGW compiler. We were able to find and use the source to recompile CyAPI with MinGW and this allowed us to successfully statically link it in our Qt project and verified that the library was functional.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I have the exact same problem in here. Would you please send me the new .lib compatible with both Qt and MinGW ??
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much !