Connect the .dll library to the project. Then made include .hpp library to main.cpp. I copied an example of using the library and got such errors.
Here is the code:
#include <QCoreApplication> #include<com_pub.hpp> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); // include application headers #define NUM_OF_RETRIES 1 GRC_TYPE RetCode; BOOLE bOpenAndRunning = FALSE; COM_BAUD_RATE cur=COM_BAUD_19200; // initialize GeoCOM RetCode = COM_Init(); if (RetCode == GRC_OK) { // open a connection to the FlexLine instrument RetCode = COM_OpenConnection (COM_1, cur, NUM_OF_RETRIES); if (RetCode == GRC_OK) { bOpenAndRunning = TRUE; } } return a.exec(); }
Here is the .pro file:
QT += core QT -= gui CONFIG += c++11 TARGET = untitled4 CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp HEADERS+=com_pub.hpp win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build-untitled4-Desktop_Qt_5_7_0_MinGW_32bit-Debug/ -lGeoComS2K else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build-untitled4-Desktop_Qt_5_7_0_MinGW_32bit-Debug/ -lGeoComS2K else:unix: LIBS += -L$$PWD/../build-untitled4-Desktop_Qt_5_7_0_MinGW_32bit-Debug/ -lGeoComS2K INCLUDEPATH += $$PWD/../build-untitled4-Desktop_Qt_5_7_0_MinGW_32bit-Debug DEPENDPATH += $$PWD/../build-untitled4-Desktop_Qt_5_7_0_MinGW_32bit-Debug