#ifndef SERIALPORTTOOL_GLOBAL_H #define SERIALPORTTOOL_GLOBAL_H #include #include "BaseSerialport.h" #ifdef SERIALPORTTOOL_LIB # define SERIALPORT_EXPORT Q_DECL_EXPORT #else # define SERIALPORT_EXPORT Q_DECL_IMPORT #endif extern "C" SERIALPORT_EXPORT ISerialPortTool* SerialPortCreate(); extern "C" SERIALPORT_EXPORT void SerialPortDelete(ISerialPortTool* pCtrl); typedef ISerialPortTool* (*_SerialPortCreate)(); #endif // SERIALPORTTOOL_GLOBAL_H /* 使用方法: 添加global头文件 QLibrary lib("SerialPortTool");//库文件名 _SerialPortCreate func = (_SerialPortCreate)lib.resolve("SerialPortCreate"); ISerialPortTool m_pUserCtrl = func(); */