#ifndef BMAP_H#define BMAP_H#include <QGraphicsView>#include "canvlib_global.h"class CANVLIB_EXPORT BMap : public QGraphicsView{public: BMap( QWidget * parent = 0 ); ~BMap();private:};#endif // BMAP_H
BMap *map = new BMap(this);map->show();
#prama once#include <QWidget>#if defined Q_WS_WIN# ifdef MYWIDGET_STATIC# define MYWIDGET_EXPORT# else# ifdef MYWIDGET_BUILD# define MYWIDGET_EXPORT __declspec(dllexport)# else# define MYWIDGET_EXPORT __declspec(dllimport)# endif# endif#else# define MYWIDGET_EXPORT#endif// define MYWIDGET_STATIC - when MyWidget sources appended directly to the project// define MYWIDGET_BUILD - when MyWidget builds as DLL// no define needed, when MyWidget linked dynamicaly to the project from DLLclass MYWIDGET_EXPORT MyWidget : public QWidget{ Q_OBJECTpublic: MyWidget( QWidget * parent = 0 );// some useful code here};
#include "MyWidget.h"MyWidget::MyWidget( QWidget * parent ) : QWidget( parent ){ ...}...// MyWidget methods definitions
TEMPLATE = libDEFINES += MYWIDGET_BUILDSOURCES = MyWidget.cppHEADERS = MyWidget.h
TEMPLATE = libCONFIG += dll
Error 15 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString const __thiscall ErrorHandler::message(void)const " (__imp_?message@ErrorHandler@@QBE?BVQString@@XZ) referenced in function "public: virtual bool __thiscall IqAuth::hookElement(class QDomElement *)" (?hookElement@IqAuth@@UAE_NPAVQDomElement@@@Z) iqauth.obj