waynew
18th December 2011, 02:55
Some of you experts tried to help me with this about a year ago (much appreciated) but I just could not get it working. So I put it aside to work on other things until now.
I have done more research and I think I understand a little more, but I still can't get it working.
Here is the situation. I have a C library I want to link to as a static library. It was built using MingW/gcc. I have both the dll and .a library files, as well as the header files. The header file contains #ifdef __cplusplus extern "C" { #endif .... #ifdef __cplusplus } #endif and the functions all have DLLEXPORTDATA extern on them.
So I looked at a lot of posts and tried all of these in my .pro file
INCLUDEPATH += "C:/development/qt_projects/hrlogger_dev_spots/debug/tqsllib/include"
//then
//this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib.a"
//or this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib.lib"
//or this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib"
with the same library file named with all of those extensions on it in that directory.
All to no avail. No joy. When I include a call to a function in the library, I get an undefined reference error, which I assume means the library is not linked.
You will have to excuse me, as I am not a C/C++ expert and I may not use the correct terminology.
I can't seem to find any Qt doc that explains how to do this.
Can someone please tell me where I am going wrong? Any help greatly appreciated.
I have done more research and I think I understand a little more, but I still can't get it working.
Here is the situation. I have a C library I want to link to as a static library. It was built using MingW/gcc. I have both the dll and .a library files, as well as the header files. The header file contains #ifdef __cplusplus extern "C" { #endif .... #ifdef __cplusplus } #endif and the functions all have DLLEXPORTDATA extern on them.
So I looked at a lot of posts and tried all of these in my .pro file
INCLUDEPATH += "C:/development/qt_projects/hrlogger_dev_spots/debug/tqsllib/include"
//then
//this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib.a"
//or this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib.lib"
//or this
LIBS += "C:/development/QT_Projects/HRLogger_Dev_Spots/debug/tqsllib/lib/libtqsllib"
with the same library file named with all of those extensions on it in that directory.
All to no avail. No joy. When I include a call to a function in the library, I get an undefined reference error, which I assume means the library is not linked.
You will have to excuse me, as I am not a C/C++ expert and I may not use the correct terminology.
I can't seem to find any Qt doc that explains how to do this.
Can someone please tell me where I am going wrong? Any help greatly appreciated.